mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
test: use function assertion for second scrollY test
This commit is contained in:
parent
3d77e267d8
commit
d981c056d1
@ -759,16 +759,16 @@ describe('nuxt links', () => {
|
|||||||
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/test')
|
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/test')
|
||||||
|
|
||||||
await page.locator('#user-test').scrollIntoViewIfNeeded()
|
await page.locator('#user-test').scrollIntoViewIfNeeded()
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
await page.waitForFunction(() => window.scrollY > 0)
|
||||||
await page.locator('#user-test').click()
|
await page.locator('#user-test').click()
|
||||||
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/user-test')
|
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/user-test')
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
await page.waitForFunction(() => window.scrollY === 0)
|
||||||
|
|
||||||
await page.locator('#test').scrollIntoViewIfNeeded()
|
await page.locator('#test').scrollIntoViewIfNeeded()
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
await page.waitForFunction(() => window.scrollY > 0)
|
||||||
await page.locator('#test').click()
|
await page.locator('#test').click()
|
||||||
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/test')
|
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/foo/test')
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
await page.waitForFunction(() => window.scrollY === 0)
|
||||||
await page.close()
|
await page.close()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user