mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
test: add default override test
This commit is contained in:
parent
794f46114f
commit
d54e58dc44
@ -2690,9 +2690,15 @@ describe('lazy import components', () => {
|
|||||||
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with viewport!').all()).toHaveLength(1)
|
expect(await page.locator('body').getByText('This shouldn\'t be visible at first with viewport!').all()).toHaveLength(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('respects custom delayed hydration triggers', async () => {
|
it('respects custom delayed hydration triggers and overrides defaults', async () => {
|
||||||
const { page } = await renderPage('/lazy-import-components')
|
const { page } = await renderPage('/lazy-import-components')
|
||||||
await page.waitForLoadState('networkidle')
|
await page.waitForLoadState('networkidle')
|
||||||
|
const component = await page.locator('#lazyevent2')
|
||||||
|
const rect = (await component.boundingBox())!
|
||||||
|
await page.mouse.move(rect.x + rect.width / 2, rect.y + rect.height / 2)
|
||||||
|
await page.waitForTimeout(500)
|
||||||
|
await page.waitForLoadState('networkidle')
|
||||||
|
expect(await page.locator('body').getByText('This should be visible at first with events!').all()).toHaveLength(2)
|
||||||
const resp = page.waitForResponse(response =>
|
const resp = page.waitForResponse(response =>
|
||||||
response.status() === 200 && response.text().then(text => text.includes('This shouldn\'t be visible at first with events!')),
|
response.status() === 200 && response.text().then(text => text.includes('This shouldn\'t be visible at first with events!')),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user