test: simplify further

This commit is contained in:
Daniel Roe 2025-03-01 15:45:08 +00:00
parent 5664181778
commit ad306f4726
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -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<string>('/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()
})