Improve the UI and tests

This commit is contained in:
Urtzi Alfaro
2025-11-15 21:21:06 +01:00
parent 86d704b354
commit 54b7a5e080
44 changed files with 2268 additions and 1414 deletions

View File

@@ -1,12 +1,19 @@
import { test, expect } from '@playwright/test';
import { acceptCookieConsent } from '../helpers/utils';
test.describe('Logout Flow', () => {
// Use authenticated state for these tests
test.use({ storageState: 'tests/.auth/user.json' });
test.beforeEach(async ({ page }) => {
// Accept cookie consent if present on any page navigation
await acceptCookieConsent(page);
});
test('should successfully logout', async ({ page }) => {
// Navigate to dashboard
await page.goto('/app/dashboard');
await acceptCookieConsent(page);
// Verify we're logged in
await expect(page.locator('body')).toContainText(/dashboard|panel de control/i);
@@ -29,8 +36,9 @@ test.describe('Logout Flow', () => {
// Should redirect to login page
await expect(page).toHaveURL(/\/(login|$)/, { timeout: 10000 });
// Verify we're logged out
await expect(page.getByLabel(/email/i)).toBeVisible();
// Verify we're logged out (check for login form)
await acceptCookieConsent(page);
await expect(page.getByLabel(/email|correo/i)).toBeVisible();
});
test('should not access protected routes after logout', async ({ page }) => {