fix: Corriger les 84 échecs E2E pré-existants
Some checks failed
CI / Backend Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Naming Conventions (push) Has been cancelled
CI / Build Check (push) Has been cancelled

Les tests E2E échouaient pour trois raisons principales :

1. Initialisation asynchrone TipTap — L'éditeur rich-text s'initialise
   via des imports dynamiques dans onMount(). Les tests interagissaient
   avec .rich-text-content avant que l'élément n'existe dans le DOM.
   Ajout d'attentes explicites avant chaque interaction avec l'éditeur.

2. Pollution inter-tests — Les fonctions de nettoyage (classes, subjects)
   ne supprimaient pas les tables dépendantes (homework, evaluations,
   schedule_slots), provoquant des erreurs FK silencieuses dans les
   try/catch. De plus, homework_submissions n'a pas de ON DELETE CASCADE
   sur homework_id, nécessitant une suppression explicite.

3. État partagé du tenant — Les règles de devoirs (homework_rules) et le
   calendrier scolaire (school_calendar_entries avec Vacances de Printemps)
   persistaient entre les fichiers de test, bloquant la création de devoirs
   dans des tests non liés aux règles.
This commit is contained in:
2026-03-26 14:47:18 +01:00
parent df25a8cbb0
commit 98be1951bf
17 changed files with 302 additions and 36 deletions

View File

@@ -442,6 +442,10 @@ test.describe('Parent Schedule Consultation (Story 4.4)', () => {
// Next class highlighting only works when viewing today's date
const jsDay = new Date().getDay();
test.skip(jsDay === 0 || jsDay === 6, 'Next class highlighting only works on weekdays');
// The seeded slot is at 23:00 — if the test runs after 22:30 the slot
// may be current/past and won't have the "next" class.
const hour = new Date().getHours();
test.skip(hour >= 23, 'Seeded 23:00 slot is past/current — cannot test next-class highlighting');
await loginAsParent(page);
await page.goto(`${ALPHA_URL}/dashboard/parent-schedule`);
@@ -457,7 +461,7 @@ test.describe('Parent Schedule Consultation (Story 4.4)', () => {
// The 23:00 slot should always be "next" during normal test hours
const nextSlot = page.locator('.slot-item.next');
await expect(nextSlot).toBeVisible({ timeout: 5000 });
await expect(nextSlot).toBeVisible({ timeout: 10000 });
// Verify the "Prochain" badge is displayed
await expect(nextSlot.locator('.next-badge')).toBeVisible();