From 4970a8093e5892f633fdb7442b66772c6edf9931 Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Fri, 20 May 2022 23:51:23 -0500 Subject: [PATCH] removing Lit tests for now --- packages/astro/e2e/lit.test.js | 102 --------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 packages/astro/e2e/lit.test.js diff --git a/packages/astro/e2e/lit.test.js b/packages/astro/e2e/lit.test.js deleted file mode 100644 index b34aaf4ca..000000000 --- a/packages/astro/e2e/lit.test.js +++ /dev/null @@ -1,102 +0,0 @@ -import { test as base, expect } from '@playwright/test'; -import { loadFixture } from './test-utils.js'; - -const test = base.extend({ - astro: async ({}, use) => { - const fixture = await loadFixture({ root: './fixtures/lit/' }); - await use(fixture); - }, -}); - -let devServer; - -test.beforeEach(async ({ astro }) => { - devServer = await astro.startDevServer(); -}); - -test.afterEach(async () => { - await devServer.stop(); -}); - -test.describe('Lit', () => { - test('client:idle', async ({ page, astro }) => { - await page.goto(astro.resolveUrl('/')); - - const counter = page.locator('#client-idle'); - await expect(counter).toBeVisible(); - - const count = counter.locator('p'); - await expect(count).toHaveText('Count: 0'); - - const inc = counter.locator('button'); - await inc.click(); - - await expect(count).toHaveText('Count: 1'); - }); - - test('client:load', async ({ page, astro }) => { - await page.goto(astro.resolveUrl('/')); - - const counter = page.locator('#client-load'); - await expect(counter).toBeVisible(); - - const count = counter.locator('p'); - await expect(count).toHaveText('Count: 0'); - - const inc = counter.locator('button'); - await inc.click(); - - await expect(count).toHaveText('Count: 1'); - }); - - test('client:visible', async ({ page, astro }) => { - await page.goto(astro.resolveUrl('/')); - - const counter = page.locator('#client-visible'); - await counter.scrollIntoViewIfNeeded(); - await expect(counter).toBeVisible(); - - const count = counter.locator('p'); - await expect(count).toHaveText('Count: 0'); - - const inc = counter.locator('button'); - await inc.click(); - - await expect(count).toHaveText('Count: 1'); - }); - - test('client:media', async ({ page, astro }) => { - await page.goto(astro.resolveUrl('/media')); - - const counter = page.locator('#client-media'); - await expect(counter).toBeVisible(); - - const count = counter.locator('p'); - await expect(count).toHaveText('Count: 0'); - - // test 1: not hydrated on large screens - const inc = counter.locator('button'); - await inc.click(); - await expect(count).toHaveText('Count: 0'); - - // test 2: hydrated on mobile (max-width: 50rem) - await page.setViewportSize({ width: 414, height: 1124 }); - await inc.click(); - await expect(count).toHaveText('Count: 1'); - }); - - test('HMR', async ({ page, astro }) => { - await page.goto(astro.resolveUrl('/')); - - // test 1: updating the page component - await astro.editFile( - './src/pages/index.astro', - (original) => original.replace('Hello, client:idle!', 'Hello, updated client:idle!') - ); - - await astro.onNextChange(); - - const label = page.locator('#client-idle h1'); - await expect(label).toHaveText('Hello, updated client:idle!') - }); -});