From ad306f47260a9039e2ff2619336f915131630d00 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 1 Mar 2025 15:45:08 +0000 Subject: [PATCH] test: simplify further --- test/basic.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index 9e72ec4db3..e826bca631 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2924,14 +2924,18 @@ describe('lazy import components', () => { }) it('handles time-based hydration correctly', async () => { - const { page } = await renderPage('/lazy-import-components/time') - const unhydratedText = 'This is not mounted.' - const hydratedText = 'This is mounted.' + const html = await $fetch('/lazy-import-components/time') + expect(html).toContain(unhydratedText) - await page.locator('[data-testid=hydrate-after]', { hasText: unhydratedText }).waitFor({ state: 'visible' }) + const { page, consoleLogs } = await renderPage('/lazy-import-components/time') + + const hydratedText = 'This is mounted.' await page.locator('[data-testid=hydrate-after]', { hasText: hydratedText }).waitFor({ state: 'visible' }) + const hydrationLogs = consoleLogs.filter(log => log.type !== 'warn') + expect(hydrationLogs.map(log => log.text)).toEqual([]) + await page.close() })