refactor: logout test
This commit is contained in:
@ -25,10 +25,16 @@ describe("logout", () => {
|
||||
expect(await page.isVisible(logoutButton))
|
||||
|
||||
await page.hover(logoutButton)
|
||||
// TODO(@jsjoeio)
|
||||
// Look into how we're attaching the handlers for the logout feature
|
||||
// We need to see how it's done upstream and add logging to the
|
||||
// handlers themselves.
|
||||
// They may be attached too slowly, hence why we need this timeout
|
||||
await page.waitForTimeout(2000)
|
||||
|
||||
await page.click(logoutButton)
|
||||
// it takes a couple seconds for url to change
|
||||
await page.waitForLoadState("networkidle")
|
||||
// Recommended by Playwright for async navigation
|
||||
// https://github.com/microsoft/playwright/issues/1987#issuecomment-620182151
|
||||
await Promise.all([page.waitForNavigation(), page.click(logoutButton)])
|
||||
const currentUrl = page.url()
|
||||
expect(currentUrl).toBe(`${CODE_SERVER_ADDRESS}/login`)
|
||||
})
|
||||
|
Reference in New Issue
Block a user