fix: enhance admin onboarding tests to verify redirection and storage state after login

This commit is contained in:
GitHub Actions
2026-02-27 01:23:53 +00:00
parent b657235870
commit ba880083be

View File

@@ -246,7 +246,18 @@ test.describe('Admin Onboarding & Setup', () => {
});
await test.step('Verify redirected to login', async () => {
await submitLoginAndWaitForDashboard(page, adminUser.email);
await expect(page).toHaveURL(/\/login|\/signin|\/auth/i, { timeout: 15000 });
const currentStorageSize = await page.evaluate(() => {
return Object.keys(localStorage).length + Object.keys(sessionStorage).length;
});
expect(currentStorageSize).toBeLessThanOrEqual(initialStorageSize);
const hasAuthStorage = await page.evaluate(() => {
const authKeys = ['auth', 'token', 'charon_auth_token'];
return authKeys.some((key) => !!localStorage.getItem(key) || !!sessionStorage.getItem(key));
});
expect(hasAuthStorage).toBe(false);
});
});