Unverified Commit d349bd08 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[test]: fix broken scroll restoration test (#85599)

parent 2f052b16
......@@ -8,7 +8,7 @@ import {
launchApp,
nextStart,
nextBuild,
check,
retry,
} from 'next-test-utils'
const appDir = join(__dirname, '../')
......@@ -35,17 +35,15 @@ const runTests = () => {
await browser.eval(() => window.next.router.push('/another'))
await check(
() => browser.eval(() => document.documentElement.innerHTML),
/hi from another/
)
await retry(async () => {
const html = await browser.eval(() => document.documentElement.innerHTML)
expect(html).toMatch(/hi from another/)
})
await browser.eval(() => (window.didHydrate = false))
await browser.eval(() => window.history.back())
await check(() => browser.eval(() => window.didHydrate), {
test(content) {
return content
},
await retry(async () => {
expect(await browser.eval(() => window.didHydrate)).toBe(true)
})
const newScrollX = Math.floor(await browser.eval(() => window.scrollX))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment