diff options
3 files changed, 17 insertions, 0 deletions
diff --git a/packages/astro/e2e/fixtures/server-islands/src/components/Self.astro b/packages/astro/e2e/fixtures/server-islands/src/components/Self.astro new file mode 100644 index 000000000..0b60a3aee --- /dev/null +++ b/packages/astro/e2e/fixtures/server-islands/src/components/Self.astro @@ -0,0 +1,8 @@ +--- +import Self from './Self.astro'; + +const now = Date(); +--- + +<p class="now">{now}</p> +{!Astro.props.stop && <Self stop server:defer />} 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 71b7d0e26..998d6c074 100644 --- a/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro @@ -1,5 +1,6 @@ --- import Island from '../components/Island.astro'; +import Self from '../components/Self.astro'; --- <html> @@ -10,5 +11,6 @@ import Island from '../components/Island.astro'; <Island server:defer> <h3 id="children">children</h3> </Island> + <Self server:defer /> </body> </html> diff --git a/packages/astro/e2e/server-islands.test.js b/packages/astro/e2e/server-islands.test.js index 5f29acf60..b036eaafa 100644 --- a/packages/astro/e2e/server-islands.test.js +++ b/packages/astro/e2e/server-islands.test.js @@ -37,6 +37,13 @@ test.describe('Server islands', () => { await expect(el, 'element rendered').toBeVisible(); }); + + test('Self imported module can server defer', async ({ page, astro }) => { + await page.goto(astro.resolveUrl('/base/')); + let el = page.locator('.now'); + + await expect(el).toHaveCount(2); + }); }); test.describe('Production', () => { |