mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-03 19:33:58 +00:00
test: add grace period for intersection observer
This commit is contained in:
parent
4e469b7de5
commit
e068873e6e
@ -2786,8 +2786,8 @@ describe('lazy import components', () => {
|
||||
await page.waitForLoadState('networkidle')
|
||||
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with conditions!').all()).toHaveLength(2)
|
||||
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight))
|
||||
await page.waitForLoadState('networkidle')
|
||||
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with viewport!').all()).toHaveLength(1)
|
||||
await page.waitForTimeout(300) // Wait for the intersection observer to fire the callback
|
||||
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with viewport!').all()).toHaveLength(2)
|
||||
expect(await page.locator('body').getByText('This should always be visible!').all()).toHaveLength(1)
|
||||
await page.close()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user