diff options
Diffstat (limited to 'packages/astro/e2e/nested-in-solid.test.js')
-rw-r--r-- | packages/astro/e2e/nested-in-solid.test.js | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/packages/astro/e2e/nested-in-solid.test.js b/packages/astro/e2e/nested-in-solid.test.js index 1c4d81ac1..3e8acddd3 100644 --- a/packages/astro/e2e/nested-in-solid.test.js +++ b/packages/astro/e2e/nested-in-solid.test.js @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { testFactory } from './test-utils.js'; +import { testFactory, waitForHydrate } from './test-utils.js'; const test = testFactory({ root: './fixtures/nested-in-solid/' }); @@ -17,13 +17,15 @@ test.describe('Nested Frameworks in Solid', () => { test('React counter', async ({ astro, page }) => { await page.goto('/'); - const counter = await page.locator('#react-counter'); + const counter = page.locator('#react-counter'); await expect(counter, 'component is visible').toBeVisible(); - const count = await counter.locator('#react-counter-count'); + const count = counter.locator('#react-counter-count'); await expect(count, 'initial count is 0').toHaveText('0'); - const increment = await counter.locator('#react-counter-increment'); + await waitForHydrate(page, counter); + + const increment = counter.locator('#react-counter-increment'); await increment.click(); await expect(count, 'count incremented by 1').toHaveText('1'); @@ -32,13 +34,15 @@ test.describe('Nested Frameworks in Solid', () => { test('Preact counter', async ({ astro, page }) => { await page.goto('/'); - const counter = await page.locator('#preact-counter'); + const counter = page.locator('#preact-counter'); await expect(counter, 'component is visible').toBeVisible(); - const count = await counter.locator('#preact-counter-count'); + const count = counter.locator('#preact-counter-count'); await expect(count, 'initial count is 0').toHaveText('0'); - const increment = await counter.locator('#preact-counter-increment'); + await waitForHydrate(page, counter); + + const increment = counter.locator('#preact-counter-increment'); await increment.click(); await expect(count, 'count incremented by 1').toHaveText('1'); @@ -47,13 +51,15 @@ test.describe('Nested Frameworks in Solid', () => { test('Solid counter', async ({ astro, page }) => { await page.goto('/'); - const counter = await page.locator('#solid-counter'); + const counter = page.locator('#solid-counter'); await expect(counter, 'component is visible').toBeVisible(); - const count = await counter.locator('#solid-counter-count'); + const count = counter.locator('#solid-counter-count'); await expect(count, 'initial count is 0').toHaveText('0'); - const increment = await counter.locator('#solid-counter-increment'); + await waitForHydrate(page, counter); + + const increment = counter.locator('#solid-counter-increment'); await increment.click(); await expect(count, 'count incremented by 1').toHaveText('1'); @@ -62,13 +68,15 @@ test.describe('Nested Frameworks in Solid', () => { test('Vue counter', async ({ astro, page }) => { await page.goto('/'); - const counter = await page.locator('#vue-counter'); + const counter = page.locator('#vue-counter'); await expect(counter, 'component is visible').toBeVisible(); - const count = await counter.locator('#vue-counter-count'); + const count = counter.locator('#vue-counter-count'); await expect(count, 'initial count is 0').toHaveText('0'); - const increment = await counter.locator('#vue-counter-increment'); + await waitForHydrate(page, counter); + + const increment = counter.locator('#vue-counter-increment'); await increment.click(); await expect(count, 'count incremented by 1').toHaveText('1'); @@ -77,13 +85,15 @@ test.describe('Nested Frameworks in Solid', () => { test('Svelte counter', async ({ astro, page }) => { await page.goto('/'); - const counter = await page.locator('#svelte-counter'); + const counter = page.locator('#svelte-counter'); await expect(counter, 'component is visible').toBeVisible(); - const count = await counter.locator('#svelte-counter-count'); + const count = counter.locator('#svelte-counter-count'); await expect(count, 'initial count is 0').toHaveText('0'); - const increment = await counter.locator('#svelte-counter-increment'); + await waitForHydrate(page, counter); + + const increment = counter.locator('#svelte-counter-increment'); await increment.click(); await expect(count, 'count incremented by 1').toHaveText('1'); |