Split up e2e HMR test (#3425)

This commit is contained in:
Matthew Phillips 2022-05-23 15:56:38 -04:00 committed by GitHub
parent 8eec97fdd1
commit 28ede84a88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,8 @@ test.describe('Multiple frameworks', () => {
await expect(bComponent, 'component text is visible').toHaveText('Hello Astro (B)');
});
test('HMR', async ({ astro, page }) => {
test.describe('HMR', () => {
test('Page template', async ({ astro, page }) => {
await page.goto('/');
// 1: updating the page template
@ -118,6 +119,10 @@ test.describe('Multiple frameworks', () => {
);
await expect(preactSlot, 'slot content updated').toHaveText('Hello Preact, updated!');
});
test('React component', async ({ astro, page }) => {
await page.goto('/');
// Edit the react component
await astro.editFile('./src/components/ReactCounter.jsx', (content) =>
@ -126,6 +131,10 @@ test.describe('Multiple frameworks', () => {
const reactCount = await page.locator('#react-counter pre');
await expect(reactCount, 'initial count updated to 5').toHaveText('5');
});
test('Svelte component', async ({ astro, page }) => {
await page.goto('/');
// Edit the svelte component's style
const svelteCounter = page.locator('#svelte-counter');
@ -144,3 +153,4 @@ test.describe('Multiple frameworks', () => {
);
});
});
});