File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2924,14 +2924,18 @@ describe('lazy import components', () => {
2924
2924
} )
2925
2925
2926
2926
it ( 'handles time-based hydration correctly' , async ( ) => {
2927
- const { page } = await renderPage ( '/lazy-import-components/time' )
2928
-
2929
2927
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' )
2931
2932
2932
- await page . locator ( '[data-testid=hydrate-after]' , { hasText : unhydratedText } ) . waitFor ( { state : 'visible' } )
2933
+ const hydratedText = 'This is mounted.'
2933
2934
await page . locator ( '[data-testid=hydrate-after]' , { hasText : hydratedText } ) . waitFor ( { state : 'visible' } )
2934
2935
2936
+ const hydrationLogs = consoleLogs . filter ( log => log . type !== 'warn' )
2937
+ expect ( hydrationLogs . map ( log => log . text ) ) . toEqual ( [ ] )
2938
+
2935
2939
await page . close ( )
2936
2940
} )
2937
2941
You can’t perform that action at this time.
0 commit comments