feat: Regrouper les cartes du dashboard admin par section thématique
Le dashboard admin affichait 16 cartes dans une grille unique sans organisation logique, obligeant l'administrateur à scanner visuellement toutes les cartes pour trouver la fonctionnalité souhaitée. Les cartes sont désormais regroupées en 5 sections cohérentes (Personnes, Organisation, Année scolaire, Paramètres, Imports) qui reflètent la structure du menu de navigation latéral.
This commit is contained in:
@@ -322,6 +322,71 @@ test.describe('Dashboard', () => {
|
||||
await expect(page.getByRole('heading', { name: 'Configuration', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: /activité récente/i })).toBeVisible();
|
||||
});
|
||||
|
||||
test('shows section titles grouping action cards', async ({ page }) => {
|
||||
await goToDashboard(page);
|
||||
await switchToDemoRole(page, 'Admin');
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Personnes', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Organisation', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Année scolaire', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Paramètres', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Imports', exact: true })).toBeVisible();
|
||||
});
|
||||
|
||||
test('groups correct cards within each section', async ({ page }) => {
|
||||
await goToDashboard(page);
|
||||
await switchToDemoRole(page, 'Admin');
|
||||
|
||||
// Personnes: Utilisateurs, Invitations parents, Élèves
|
||||
const personnes = page.locator('section[aria-labelledby="section-personnes"]');
|
||||
await expect(personnes.locator('.action-card')).toHaveCount(3);
|
||||
await expect(personnes.locator('.action-card[href="/admin/users"]')).toBeVisible();
|
||||
await expect(personnes.locator('.action-card[href="/admin/parent-invitations"]')).toBeVisible();
|
||||
await expect(personnes.locator('.action-card[href="/admin/students"]')).toBeVisible();
|
||||
|
||||
// Organisation: Classes, Matières, Affectations, Remplacements, Emploi du temps
|
||||
const organisation = page.locator('section[aria-labelledby="section-organisation"]');
|
||||
await expect(organisation.locator('.action-card')).toHaveCount(5);
|
||||
await expect(organisation.locator('.action-card[href="/admin/classes"]')).toBeVisible();
|
||||
await expect(organisation.locator('.action-card[href="/admin/subjects"]')).toBeVisible();
|
||||
await expect(organisation.locator('.action-card[href="/admin/assignments"]')).toBeVisible();
|
||||
await expect(organisation.locator('.action-card[href="/admin/replacements"]')).toBeVisible();
|
||||
await expect(organisation.locator('.action-card[href="/admin/schedule"]')).toBeVisible();
|
||||
|
||||
// Année scolaire: Périodes scolaires, Calendrier
|
||||
const anneeScolaire = page.locator('section[aria-labelledby="section-annee-scolaire"]');
|
||||
await expect(anneeScolaire.locator('.action-card')).toHaveCount(2);
|
||||
await expect(anneeScolaire.locator('.action-card[href="/admin/academic-year/periods"]')).toBeVisible();
|
||||
await expect(anneeScolaire.locator('.action-card[href="/admin/calendar"]')).toBeVisible();
|
||||
|
||||
// Paramètres: Droit à l'image, Pédagogie, Identité visuelle, Règles de devoirs
|
||||
const parametres = page.locator('section[aria-labelledby="section-parametres"]');
|
||||
await expect(parametres.locator('.action-card')).toHaveCount(4);
|
||||
await expect(parametres.locator('.action-card[href="/admin/image-rights"]')).toBeVisible();
|
||||
await expect(parametres.locator('.action-card[href="/admin/pedagogy"]')).toBeVisible();
|
||||
await expect(parametres.locator('.action-card[href="/admin/branding"]')).toBeVisible();
|
||||
await expect(parametres.locator('.action-card[href="/admin/homework-rules"]')).toBeVisible();
|
||||
|
||||
// Imports: Importer des élèves, Importer des enseignants
|
||||
const imports = page.locator('section[aria-labelledby="section-imports"]');
|
||||
await expect(imports.locator('.action-card')).toHaveCount(2);
|
||||
await expect(imports.locator('.action-card[href="/admin/import/students"]')).toBeVisible();
|
||||
await expect(imports.locator('.action-card[href="/admin/import/teachers"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test('sections are displayed in the expected order', async ({ page }) => {
|
||||
await goToDashboard(page);
|
||||
await switchToDemoRole(page, 'Admin');
|
||||
|
||||
const sectionTitles = page.locator('.dashboard-section .section-title');
|
||||
await expect(sectionTitles).toHaveCount(5);
|
||||
await expect(sectionTitles.nth(0)).toHaveText('Personnes');
|
||||
await expect(sectionTitles.nth(1)).toHaveText('Organisation');
|
||||
await expect(sectionTitles.nth(2)).toHaveText('Année scolaire');
|
||||
await expect(sectionTitles.nth(3)).toHaveText('Paramètres');
|
||||
await expect(sectionTitles.nth(4)).toHaveText('Imports');
|
||||
});
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user