mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-19 16:01:24 +00:00
test: simplify further
This commit is contained in:
parent
5664181778
commit
ad306f4726
@ -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()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user