mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Verify you can use server:defer on self-imported module (#11577)
This commit is contained in:
parent
49db00444e
commit
60b2766edb
3 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
import Self from './Self.astro';
|
||||
|
||||
const now = Date();
|
||||
---
|
||||
|
||||
<p class="now">{now}</p>
|
||||
{!Astro.props.stop && <Self stop server:defer />}
|
|
@ -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>
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in a new issue