From 8326cfddf70530276c74e4f1accaa4a237f28be2 Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Mon, 16 May 2022 13:41:42 -0500 Subject: [PATCH] fixing up svelte tests --- .../svelte/src/components/Counter.svelte | 12 +++++++----- .../e2e/fixtures/svelte/src/pages/index.astro | 18 +++++++++++++++--- packages/astro/e2e/svelte.test.js | 6 +++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/packages/astro/e2e/fixtures/svelte/src/components/Counter.svelte b/packages/astro/e2e/fixtures/svelte/src/components/Counter.svelte index 2f4c07339..264ec9dde 100644 --- a/packages/astro/e2e/fixtures/svelte/src/components/Counter.svelte +++ b/packages/astro/e2e/fixtures/svelte/src/components/Counter.svelte @@ -1,4 +1,6 @@ - -
- +
+
{ count }
- +
-
+
diff --git a/packages/astro/e2e/fixtures/svelte/src/pages/index.astro b/packages/astro/e2e/fixtures/svelte/src/pages/index.astro index 92b8db23e..e44f4e7cc 100644 --- a/packages/astro/e2e/fixtures/svelte/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/svelte/src/pages/index.astro @@ -11,8 +11,20 @@ const someProps = { - -

Hello, Svelte!

-
+ +

Hello, client:idle!

+
+ + +

Hello, client:load!

+
+ + +

Hello, client:visible!

+
+ + +

Hello, client:media!

+
diff --git a/packages/astro/e2e/svelte.test.js b/packages/astro/e2e/svelte.test.js index 9c21c78eb..fdb47ab60 100644 --- a/packages/astro/e2e/svelte.test.js +++ b/packages/astro/e2e/svelte.test.js @@ -88,12 +88,12 @@ test.only('Svelte', async ({ page, astro }) => { // test 1: updating the page component await astro.writeFile( 'src/pages/index.astro', - (original) => original.replace('id="counter-idle" {...someProps}', 'id="counter-idle" count={5}') + (original) => original.replace('Hello, client:idle!', 'Hello, updated client:idle!') ); await afterHMR; - const count = page.locator('#counter-idle pre'); - await expect(count).toHaveText('5'); + const label = page.locator('#counter-idle-message'); + await expect(label).toHaveText('Hello, updated client:idle!'); }); });