From 31bcd811014a253528e37d5c199076f9c123b963 Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Mon, 16 May 2022 13:57:22 -0500 Subject: [PATCH] chore: test cleanup --- .../e2e/fixtures/preact/src/pages/index.astro | 4 ++++ .../astro/e2e/fixtures/react/src/pages/index.astro | 4 ++++ .../astro/e2e/fixtures/solid/src/pages/index.astro | 4 ++++ .../e2e/fixtures/svelte/src/pages/index.astro | 4 ++++ packages/astro/e2e/lit.test.js | 1 + packages/astro/e2e/preact.test.js | 14 ++++++++++++++ packages/astro/e2e/react.test.js | 14 ++++++++++++++ packages/astro/e2e/solid.test.js | 14 ++++++++++++++ packages/astro/e2e/svelte.test.js | 14 ++++++++++++++ packages/astro/e2e/vue.test.js | 3 ++- 10 files changed, 75 insertions(+), 1 deletion(-) diff --git a/packages/astro/e2e/fixtures/preact/src/pages/index.astro b/packages/astro/e2e/fixtures/preact/src/pages/index.astro index 597398500..ab6c1e2a2 100644 --- a/packages/astro/e2e/fixtures/preact/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/preact/src/pages/index.astro @@ -12,6 +12,10 @@ const someProps = { + +

Hello, server!

+
+

Hello, client:idle!

diff --git a/packages/astro/e2e/fixtures/react/src/pages/index.astro b/packages/astro/e2e/fixtures/react/src/pages/index.astro index 7a847044e..d087be5bb 100644 --- a/packages/astro/e2e/fixtures/react/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/react/src/pages/index.astro @@ -12,6 +12,10 @@ const someProps = { + +

Hello, server!

+
+

Hello, client:idle!

diff --git a/packages/astro/e2e/fixtures/solid/src/pages/index.astro b/packages/astro/e2e/fixtures/solid/src/pages/index.astro index 28d736895..70578fac5 100644 --- a/packages/astro/e2e/fixtures/solid/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/solid/src/pages/index.astro @@ -11,6 +11,10 @@ const someProps = { + +

Hello, server!

+
+

Hello, client:idle!

diff --git a/packages/astro/e2e/fixtures/svelte/src/pages/index.astro b/packages/astro/e2e/fixtures/svelte/src/pages/index.astro index e44f4e7cc..d253fc1d7 100644 --- a/packages/astro/e2e/fixtures/svelte/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/svelte/src/pages/index.astro @@ -11,6 +11,10 @@ const someProps = { + +

Hello, server!

+
+

Hello, client:idle!

diff --git a/packages/astro/e2e/lit.test.js b/packages/astro/e2e/lit.test.js index 8f5152a00..bf900a669 100644 --- a/packages/astro/e2e/lit.test.js +++ b/packages/astro/e2e/lit.test.js @@ -57,6 +57,7 @@ test.only('Lit', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); const counter = page.locator('#counter-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); const count = counter.locator('p'); diff --git a/packages/astro/e2e/preact.test.js b/packages/astro/e2e/preact.test.js index 9950d2035..2e44b5761 100644 --- a/packages/astro/e2e/preact.test.js +++ b/packages/astro/e2e/preact.test.js @@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => { test.only('Preact', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); + await test.step('server only', async () => { + const counter = page.locator('#server-only'); + await expect(counter).toBeVisible(); + + const count = counter.locator('pre'); + await expect(count).toHaveText('0'); + + const inc = counter.locator('.increment'); + await inc.click(); + + await expect(count).toHaveText('0'); + }); + await test.step('client:idle', async () => { const counter = page.locator('#counter-idle'); await expect(counter).toBeVisible(); @@ -53,6 +66,7 @@ test.only('Preact', async ({ page, astro }) => { await test.step('client:visible', async () => { const counter = page.locator('#counter-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); const count = counter.locator('pre'); diff --git a/packages/astro/e2e/react.test.js b/packages/astro/e2e/react.test.js index b1fcb1d2f..bcffdc572 100644 --- a/packages/astro/e2e/react.test.js +++ b/packages/astro/e2e/react.test.js @@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => { test.only('React', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); + await test.step('server only', async () => { + const counter = page.locator('#server-only'); + await expect(counter).toBeVisible(); + + const count = counter.locator('pre'); + await expect(count).toHaveText('0'); + + const inc = counter.locator('.increment'); + await inc.click(); + + await expect(count).toHaveText('0'); + }); + await test.step('client:idle', async () => { const counter = page.locator('#counter-idle'); await expect(counter).toBeVisible(); @@ -53,6 +66,7 @@ test.only('React', async ({ page, astro }) => { await test.step('client:visible', async () => { const counter = page.locator('#counter-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); const count = counter.locator('pre'); diff --git a/packages/astro/e2e/solid.test.js b/packages/astro/e2e/solid.test.js index 2ba4449e4..4a0250c4c 100644 --- a/packages/astro/e2e/solid.test.js +++ b/packages/astro/e2e/solid.test.js @@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => { test.only('Solid', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); + await test.step('server only', async () => { + const counter = page.locator('#server-only'); + await expect(counter).toBeVisible(); + + const count = counter.locator('pre'); + await expect(count).toHaveText('0'); + + const inc = counter.locator('.increment'); + await inc.click(); + + await expect(count).toHaveText('0'); + }); + await test.step('client:idle', async () => { const counter = page.locator('#counter-idle'); await expect(counter).toBeVisible(); @@ -53,6 +66,7 @@ test.only('Solid', async ({ page, astro }) => { await test.step('client:visible', async () => { const counter = page.locator('#counter-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); const count = counter.locator('pre'); diff --git a/packages/astro/e2e/svelte.test.js b/packages/astro/e2e/svelte.test.js index fdb47ab60..87bf16252 100644 --- a/packages/astro/e2e/svelte.test.js +++ b/packages/astro/e2e/svelte.test.js @@ -25,6 +25,19 @@ test.afterEach(async ({ astro }) => { test.only('Svelte', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); + await test.step('server only', async () => { + const counter = page.locator('#server-only'); + await expect(counter).toBeVisible(); + + const count = counter.locator('pre'); + await expect(count).toHaveText('0'); + + const inc = counter.locator('.increment'); + await inc.click(); + + await expect(count).toHaveText('0'); + }); + await test.step('client:idle', async () => { const counter = page.locator('#counter-idle'); await expect(counter).toBeVisible(); @@ -53,6 +66,7 @@ test.only('Svelte', async ({ page, astro }) => { await test.step('client:visible', async () => { const counter = page.locator('#counter-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); const count = counter.locator('pre'); diff --git a/packages/astro/e2e/vue.test.js b/packages/astro/e2e/vue.test.js index 7b55baf5a..6389556c1 100644 --- a/packages/astro/e2e/vue.test.js +++ b/packages/astro/e2e/vue.test.js @@ -25,7 +25,7 @@ test.afterEach(async ({ astro }) => { test.only('Vue', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); - await test.step('client:only', async () => { + await test.step('server only', async () => { const counter = page.locator('#server-only'); await expect(counter).toBeVisible(); @@ -90,6 +90,7 @@ test.only('Vue', async ({ page, astro }) => { await test.step('client:visible', async () => { const counter = page.locator('#client-visible'); + await counter.scrollIntoViewIfNeeded(); await expect(counter).toBeVisible(); await counter.scrollIntoViewIfNeeded();