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
1 changed files with 2 additions and 3 deletions

View File

@ -2637,11 +2637,10 @@ describe('lazy import components', () => {
it('lazy load delayed hydration comps at the right time', async () => {
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')
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 response
expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(1)
})
})