feat: Dashboard placeholder avec preview Score Sérénité
Permet aux parents de visualiser une démo du Score Sérénité dès leur première connexion, avant même que les données réelles soient disponibles. Les autres rôles (enseignant, élève, admin) ont également leur dashboard adapté avec des sections placeholder. La landing page redirige automatiquement vers /dashboard si l'utilisateur est déjà authentifié, offrant un accès direct au tableau de bord.
This commit is contained in:
@@ -49,7 +49,7 @@ async function login(page: import('@playwright/test').Page, email: string) {
|
||||
await page.locator('#email').fill(email);
|
||||
await page.locator('#password').fill(TEST_PASSWORD);
|
||||
await page.getByRole('button', { name: /se connecter/i }).click();
|
||||
await page.waitForURL(getTenantUrl('/'), { timeout: 10000 });
|
||||
await page.waitForURL(getTenantUrl('/dashboard'), { timeout: 10000 });
|
||||
}
|
||||
|
||||
test.describe('Sessions Management', () => {
|
||||
@@ -260,13 +260,13 @@ test.describe('Sessions Management', () => {
|
||||
await login(page, email);
|
||||
await page.goto(getTenantUrl('/settings'));
|
||||
|
||||
// Click logout button and wait for navigation
|
||||
const logoutButton = page.getByRole('button', { name: /déconnexion/i });
|
||||
// Click logout button
|
||||
const logoutButton = page.getByRole('button', { name: /d[eé]connexion/i });
|
||||
await expect(logoutButton).toBeVisible();
|
||||
await Promise.all([
|
||||
page.waitForURL(/login/, { timeout: 10000 }),
|
||||
logoutButton.click()
|
||||
]);
|
||||
await logoutButton.click();
|
||||
|
||||
// Wait for redirect to login
|
||||
await expect(page).toHaveURL(/login/, { timeout: 10000 });
|
||||
});
|
||||
|
||||
test('logout clears authentication', async ({ page, browserName }, testInfo) => {
|
||||
@@ -278,13 +278,13 @@ test.describe('Sessions Management', () => {
|
||||
await login(page, email);
|
||||
await page.goto(getTenantUrl('/settings'));
|
||||
|
||||
// Logout - wait for navigation to complete
|
||||
const logoutButton = page.getByRole('button', { name: /déconnexion/i });
|
||||
// Logout
|
||||
const logoutButton = page.getByRole('button', { name: /d[eé]connexion/i });
|
||||
await expect(logoutButton).toBeVisible();
|
||||
await Promise.all([
|
||||
page.waitForURL(/login/, { timeout: 10000 }),
|
||||
logoutButton.click()
|
||||
]);
|
||||
await logoutButton.click();
|
||||
|
||||
// Wait for redirect to login
|
||||
await expect(page).toHaveURL(/login/, { timeout: 10000 });
|
||||
|
||||
// Try to access protected page
|
||||
await page.goto(getTenantUrl('/settings/sessions'));
|
||||
|
||||
Reference in New Issue
Block a user