Skip to content

Commit

Permalink
test: add wait timeout between clicks for rsc link (vercel#32376)
Browse files Browse the repository at this point in the history
Stabilize flaky test

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
huozhi and ijjk authored Dec 10, 2021
1 parent 83e6610 commit 0f96308
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,12 @@ async function runBasicTests(context, env) {

const browser = await webdriver(context.appPort, '/next-api/link')
await browser.eval('window.beforeNav = 1')
await browser.elementByCss('#next_id').click()
await browser.elementByCss('#next_id').click()
await check(() => browser.waitForElementByCss('#query').text(), /query:2/)

if (!isDev) {
// this might do a hard navigation in development
// so only require this check in production
expect(await browser.eval('window.beforeNav')).toBe(1)
}
await browser.waitForElementByCss('#next_id').click()
await check(() => browser.elementByCss('#query').text(), 'query:1')

await browser.waitForElementByCss('#next_id').click()
await check(() => browser.elementByCss('#query').text(), 'query:2')
expect(await browser.eval('window.beforeNav')).toBe(1)
})

it('should suspense next/image on server side', async () => {
Expand Down

0 comments on commit 0f96308

Please sign in to comment.