diff options
author | 2023-02-15 22:28:59 +0800 | |
---|---|---|
committer | 2023-02-15 22:28:59 +0800 | |
commit | 5c7c7e463dbffc9a573e3fec80a4daaf4621cd83 (patch) | |
tree | 994dac0b5972653695e22856bb8b570097e75889 /packages/astro/e2e/svelte-component.test.js | |
parent | 4b89c2b553aa93c53d6262f473f0fe793e034614 (diff) | |
download | astro-5c7c7e463dbffc9a573e3fec80a4daaf4621cd83.tar.gz astro-5c7c7e463dbffc9a573e3fec80a4daaf4621cd83.tar.zst astro-5c7c7e463dbffc9a573e3fec80a4daaf4621cd83.zip |
Fix unmount Svelte slots (#6250)
Diffstat (limited to '')
-rw-r--r-- | packages/astro/e2e/svelte-component.test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/astro/e2e/svelte-component.test.js b/packages/astro/e2e/svelte-component.test.js index d267aeafe..30ed2eeb4 100644 --- a/packages/astro/e2e/svelte-component.test.js +++ b/packages/astro/e2e/svelte-component.test.js @@ -1,3 +1,4 @@ +import { expect } from '@playwright/test'; import { prepareTestFactory } from './shared-component-tests.js'; const { test, createTests } = prepareTestFactory({ root: './fixtures/svelte-component/' }); @@ -23,3 +24,14 @@ test.describe('Svelte components in MDX files', () => { pageSourceFilePath: './src/pages/mdx.mdx', }); }); + +test.describe('Svelte components lifecycle', () => { + test('slot should unmount properly', async ({ page, astro }) => { + await page.goto(astro.resolveUrl('/')); + + const toggle = page.locator('#toggle'); + expect((await toggle.textContent()).trim()).toBe('close'); + await toggle.click() + expect((await toggle.textContent()).trim()).toBe('open'); + }); +}); |