feat: Permettre à l'enseignant de rédiger avec un éditeur riche et joindre des fichiers
Les enseignants avaient besoin de consignes plus claires pour les élèves : le champ description en texte brut ne permettait ni mise en forme ni partage de documents. Cette limitation obligeait à décrire verbalement les ressources au lieu de les joindre directement. L'éditeur WYSIWYG (TipTap) remplace le textarea avec gras, italique, listes et liens. Le contenu HTML est sanitisé côté backend via symfony/html-sanitizer pour prévenir les injections XSS. Les pièces jointes (PDF, JPEG, PNG, max 10 Mo) sont uploadées via une API dédiée avec validation MIME côté domaine et protection path-traversal sur le téléchargement. Les descriptions en texte brut existantes restent lisibles sans migration de données.
This commit is contained in:
@@ -217,7 +217,7 @@ test.describe('Homework Management (Story 5.1)', () => {
|
||||
await page.locator('#hw-title').fill('Exercices chapitre 5');
|
||||
|
||||
// Fill description
|
||||
await page.locator('#hw-description').fill('Pages 42-45, exercices 1 à 10');
|
||||
await page.locator('.modal .rich-text-content').click(); await page.locator('.modal .rich-text-content').pressSequentially('Pages 42-45, exercices 1 à 10');
|
||||
|
||||
// Set due date (next weekday, at least 2 days from now)
|
||||
await page.locator('#hw-due-date').fill(getNextWeekday(3));
|
||||
@@ -389,7 +389,7 @@ test.describe('Homework Management (Story 5.1)', () => {
|
||||
await page.locator('#hw-class').selectOption({ index: 1 });
|
||||
await page.locator('#hw-subject').selectOption({ index: 1 });
|
||||
await page.locator('#hw-title').fill('Devoir date passée');
|
||||
await page.locator('#hw-description').fill('Test validation');
|
||||
await page.locator('.modal .rich-text-content').click(); await page.locator('.modal .rich-text-content').pressSequentially('Test validation');
|
||||
|
||||
// Set a past date — fill() works with Svelte 5 bind:value
|
||||
const yesterday = new Date();
|
||||
@@ -686,7 +686,7 @@ test.describe('Homework Management (Story 5.1)', () => {
|
||||
await page.locator('#hw-class').selectOption({ index: 1 });
|
||||
await page.locator('#hw-subject').selectOption({ index: 1 });
|
||||
await page.locator('#hw-title').fill('Titre original');
|
||||
await page.locator('#hw-description').fill('Description inchangée');
|
||||
await page.locator('.modal .rich-text-content').click(); await page.locator('.modal .rich-text-content').pressSequentially('Description inchangée');
|
||||
await page.locator('#hw-due-date').fill(dueDate);
|
||||
await page.getByRole('button', { name: /créer le devoir/i }).click();
|
||||
await expect(page.getByRole('dialog')).not.toBeVisible({ timeout: 10000 });
|
||||
@@ -698,7 +698,7 @@ test.describe('Homework Management (Story 5.1)', () => {
|
||||
await expect(editDialog).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Verify pre-filled values
|
||||
await expect(page.locator('#edit-description')).toHaveValue('Description inchangée');
|
||||
await expect(page.locator('.modal .rich-text-content')).toContainText('Description inchangée');
|
||||
await expect(page.locator('#edit-due-date')).toHaveValue(dueDate);
|
||||
|
||||
// Change only the title
|
||||
|
||||
Reference in New Issue
Block a user