Fix flaky logout test by waiting for navigation

The dispatchEvent('click') on Sign Out triggers a navigation. Wait
for it to complete before checking for the Sign In link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-02-18 03:03:15 +01:00
co-authored by Claude Opus 4.6
parent 4a0366d696
commit 30b9a05082
+1
View File
@@ -12,5 +12,6 @@ export async function login(page: Page) {
export async function logout(page: Page) {
await page.getByText('Sign Out').dispatchEvent('click');
await page.waitForURL('**/');
await expect(page.getByRole('link', {name: 'Sign In'})).toBeVisible();
}