Skip to content

Commit

Permalink
Fixed flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
AkifumiSato committed Apr 16, 2022
1 parent 4d152d5 commit 993e2d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e/reload-scroll-backforward-restoration/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('reload-scroll-back-restoration', () => {
await browser.eval(`window.next.router.push('/2')`)

// check restore value on history index: 1
await browser.eval(() => window.history.back())
await browser.back()
await check(
() => browser.eval(() => document.documentElement.innerHTML),
/hydrated/
Expand All @@ -60,10 +60,10 @@ describe('reload-scroll-back-restoration', () => {
Math.floor(await browser.eval(() => window.scrollY))
)

await browser.eval(`window.next.router.reload()`)
await browser.refresh()

// check restore value on history index: 0
await browser.eval(() => window.history.back())
await browser.back()
await check(
() => browser.eval(() => document.documentElement.innerHTML),
/hydrated/
Expand Down Expand Up @@ -111,9 +111,9 @@ describe('reload-scroll-back-restoration', () => {
})

// check restore value on history index: 1
await browser.eval(() => window.history.back())
await browser.eval(() => window.history.back())
await browser.eval(() => window.history.forward())
await browser.back()
await browser.back()
await browser.forward()
await check(
() => browser.eval(() => document.documentElement.innerHTML),
/hydrated/
Expand All @@ -126,10 +126,10 @@ describe('reload-scroll-back-restoration', () => {
Math.floor(await browser.eval(() => window.scrollY))
)

await browser.eval(`window.next.router.reload()`)
await browser.refresh()

// check restore value on history index: 2
await browser.eval(() => window.history.forward())
await browser.forward()
await check(
() => browser.eval(() => document.documentElement.innerHTML),
/hydrated/
Expand Down

0 comments on commit 993e2d2

Please sign in to comment.