8000 test: simplify further · nuxt/nuxt@ad306f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad306f4

Browse files
committed
test: simplify further
1 parent 5664181 commit ad306f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/basic.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,14 +2924,18 @@ describe('lazy import components', () => {
29242924
})
29252925

29262926
it('handles time-based hydration correctly', async () => {
2927-
const { page } = await renderPage('/lazy-import-components/time')
2928-
29292927
const unhydratedText = 'This is not mounted.'
2930-
const hydratedText = 'This is mounted.'
2928+
const html = await $fetch<string>('/lazy-import-components/time')
2929+
expect(html).toContain(unhydratedText)
2930+
2931+
const { page, consoleLogs } = await renderPage('/lazy-import-components/time')
29312932

2932-
await page.locator('[data-testid=hydrate-after]', { hasText: unhydratedText }).waitFor({ state: 'visible' })
2933+
const hydratedText = 'This is mounted.'
29332934
await page.locator('[data-testid=hydrate-after]', { hasText: hydratedText }).waitFor({ state: 'visible' })
29342935

2936+
const hydrationLogs = consoleLogs.filter(log => log.type !== 'warn')
2937+
expect(hydrationLogs.map(log => log.text)).toEqual([])
2938+
29352939
await page.close()
29362940
})
29372941

0 commit comments

Comments
 (0)
0