aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2025-06-06 10:56:15 -0700
committerGravatar Anshul Gupta <ansg191@anshulg.com> 2025-06-06 19:34:37 -0700
commit7d7b3160068171542145331c3e22db9a81261a89 (patch)
treeaf2f1496a3bef80df35f9fa9e47a67514d385200
parente667a3b6f0ba56c9a7edeb22f9ae479434e20b2d (diff)
downloadastro-fix-s-island-fallback.tar.gz
astro-fix-s-island-fallback.tar.zst
astro-fix-s-island-fallback.zip
test: add e2e test for fallback removalfix-s-island-fallback
-rw-r--r--packages/astro/e2e/fixtures/server-islands/src/pages/index.astro4
-rw-r--r--packages/astro/e2e/server-islands.test.js7
2 files changed, 11 insertions, 0 deletions
diff --git a/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro b/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
index f15cc5344..426e6d4bd 100644
--- a/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
+++ b/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
@@ -29,6 +29,10 @@ export const prerender = false;
<Island server:defer secret="test" content={content} />
</div>
+ <Island server:defer>
+ <p slot="fallback" id="fallback">I am a fallback</p>
+ </Island>
+
<div id="error-test">
<HTMLError server:defer>
<script is:inline slot="fallback">
diff --git a/packages/astro/e2e/server-islands.test.js b/packages/astro/e2e/server-islands.test.js
index dd764eb84..29ad65919 100644
--- a/packages/astro/e2e/server-islands.test.js
+++ b/packages/astro/e2e/server-islands.test.js
@@ -79,6 +79,13 @@ test.describe('Server islands', () => {
let el = page.locator('#first');
await expect(el).toHaveCount(1);
});
+
+ test('Fallback is deleted when server island is rendered', async ({ page, astro }) => {
+ await page.goto(astro.resolveUrl('/base/'));
+ await page.waitForLoadState('networkidle');
+ let el = page.locator('#fallback');
+ await expect(el).toHaveCount(0);
+ });
});
test.describe('Development - trailingSlash: ignore', () => {