test: named LazyVisible components

This commit is contained in:
Michael Brevard 2024-06-02 21:56:49 +03:00 committed by GitHub
parent b143038cef
commit b1c498bea7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2637,11 +2637,10 @@ describe('lazy import components', () => {
it('lazy load delayed hydration comps at the right time', async () => { it('lazy load delayed hydration comps at the right time', async () => {
expect(html).not.toContain('This shouldn\'t be visible at first!') expect(html).not.toContain('This shouldn\'t be visible at first!')
expect(html).toContain('This should be visible at first!')
const { page } = await renderPage('/lazy-import-components') const { page } = await renderPage('/lazy-import-components')
expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(1)
const response = page.waitForResponse(response => response.url().includes('DelayedWrapperTestComponent') && response.status() === 200)
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)) await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight))
await response expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(1)
}) })
}) })