fix: add timeout to logout test

This commit is contained in:
Joe Previte 2021-03-23 12:14:42 -07:00
parent 090687d057
commit 9eff1f0702
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24

View File

@ -47,11 +47,8 @@ describe("logout", () => {
await page.hover(logoutButton)
await page.click(logoutButton)
// it takes a second to navigate
// and since page.url comes back immediately
// we need this waitForNavigation, otherwise it will check
// before navigation has finished and fail
await page.waitForNavigation({ url: `${CODE_SERVER_ADDRESS}/login` })
// it takes a couple seconds to navigate
await page.waitForTimeout(2000)
const currentUrl = page.url()
expect(currentUrl).toBe(`${CODE_SERVER_ADDRESS}/login`)
})