Files
Classeo/frontend/e2e/dashboard.spec.ts
Mathias STRASSER b45ef735db 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.
2026-02-04 18:34:08 +01:00

37 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Dashboard', () => {
// Dashboard shows demo content without authentication (Story 1.9)
test('shows demo content when not authenticated', async ({ page }) => {
await page.goto('/dashboard');
// Dashboard is accessible without auth - shows demo mode
await expect(page).toHaveURL(/\/dashboard/);
// Role switcher visible (shows demo banner)
await expect(page.getByText(/Démo - Changer de rôle/i)).toBeVisible();
});
test.describe('when authenticated', () => {
// These tests would run with a logged-in user
// For now, we test the public behavior
test('dashboard page exists and loads', async ({ page }) => {
// First, try to access dashboard
const response = await page.goto('/dashboard');
// The page should load (even if it redirects)
expect(response?.status()).toBeLessThan(500);
});
});
});
test.describe('Dashboard Components', () => {
test('demo data JSON is valid and accessible', async ({ page }) => {
// This tests that the demo data file is bundled correctly
await page.goto('/');
// The app should load without errors
await expect(page.locator('body')).toBeVisible();
});
});