fix: Corriger les tests E2E du dashboard admin après ajout des sections thématiques
Les tests attendaient 5 sections mais le dashboard en affiche 8 (5 thématiques + 3 placeholders DashboardSection). Le heading sr-only "Actions de configuration" manquait pour l'accessibilité.
This commit is contained in:
@@ -380,12 +380,15 @@ test.describe('Dashboard', () => {
|
|||||||
await switchToDemoRole(page, 'Admin');
|
await switchToDemoRole(page, 'Admin');
|
||||||
|
|
||||||
const sectionTitles = page.locator('.dashboard-section .section-title');
|
const sectionTitles = page.locator('.dashboard-section .section-title');
|
||||||
await expect(sectionTitles).toHaveCount(5);
|
await expect(sectionTitles).toHaveCount(8);
|
||||||
await expect(sectionTitles.nth(0)).toHaveText('Personnes');
|
await expect(sectionTitles.nth(0)).toHaveText('Personnes');
|
||||||
await expect(sectionTitles.nth(1)).toHaveText('Organisation');
|
await expect(sectionTitles.nth(1)).toHaveText('Organisation');
|
||||||
await expect(sectionTitles.nth(2)).toHaveText('Année scolaire');
|
await expect(sectionTitles.nth(2)).toHaveText('Année scolaire');
|
||||||
await expect(sectionTitles.nth(3)).toHaveText('Paramètres');
|
await expect(sectionTitles.nth(3)).toHaveText('Paramètres');
|
||||||
await expect(sectionTitles.nth(4)).toHaveText('Imports');
|
await expect(sectionTitles.nth(4)).toHaveText('Imports');
|
||||||
|
await expect(sectionTitles.nth(5)).toHaveText('Utilisateurs');
|
||||||
|
await expect(sectionTitles.nth(6)).toHaveText('Configuration');
|
||||||
|
await expect(sectionTitles.nth(7)).toHaveText('Activité récente');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<h2 class="sr-only">Actions de configuration</h2>
|
||||||
|
|
||||||
{#each dashboardSections as section (section.id)}
|
{#each dashboardSections as section (section.id)}
|
||||||
<section class="dashboard-section" aria-labelledby="section-{section.id}">
|
<section class="dashboard-section" aria-labelledby="section-{section.id}">
|
||||||
<h2 id="section-{section.id}" class="section-title">{section.title}</h2>
|
<h2 id="section-{section.id}" class="section-title">{section.title}</h2>
|
||||||
@@ -141,6 +143,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.dashboard-admin {
|
.dashboard-admin {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user