test) fixing tests
All checks were successful
PR Checks / lint-test-and-docker-build (pull_request) Successful in 2m15s

This commit is contained in:
2026-02-22 17:27:22 -05:00
parent 1ef5deeb98
commit b54dd351fc
3 changed files with 23 additions and 14 deletions

View File

@@ -13,15 +13,6 @@ async function loginAsLocalUser(page: Page, username: string, password: string):
await page.waitForURL(`**${DASHBOARD_URL}`, { timeout: 15_000 });
}
async function clearSessionState(page: Page): Promise<void> {
await page.context().clearCookies();
await page.goto('about:blank');
await page.evaluate(() => {
localStorage.clear();
sessionStorage.clear();
});
}
test.beforeEach(async ({ context }) => {
await context.clearCookies();
});
@@ -47,9 +38,9 @@ test('admin can create a local user who can sign in', async ({ page }) => {
await addDialog.locator('input[type="password"]').nth(1).fill(password);
await addDialog.getByRole('button', { name: 'Create user' }).click();
await expect(page.getByRole('cell', { name: username })).toBeVisible();
await expect(page.getByRole('cell', { name: username, exact: true })).toBeVisible();
await clearSessionState(page);
await page.context().clearCookies();
await loginAsLocalUser(page, username, password);
await expect(page).toHaveURL(/\/trips\/dashboard/);