Share toolbox components and fix image and calendar updates
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s

This commit is contained in:
Shinuwa 2026-09-10 14:19:55 +02:00
parent 865a4ffd97
commit 34524d2961
13 changed files with 117 additions and 93 deletions

24
e2e/library.spec.js Normal file
View file

@ -0,0 +1,24 @@
// Rôle : vérifie le chargement des outils de chaque catégorie de la librairie.
import { test, expect } from "@playwright/test";
import { LIBRARY_CATEGORY_DEFINITIONS } from "../website/src/features/toolboxes/toolboxModuleRegistry.js";
test("loads every library tool through the shared component registry", async ({ page }) => {
const errors = [];
page.on("pageerror", (error) => errors.push(error.message));
page.on("console", (message) => {
if (message.type() === "error") errors.push(message.text());
});
await page.goto("/#/library");
for (const category of LIBRARY_CATEGORY_DEFINITIONS) {
await page.locator(`.library-doc-nav-group > a[href="#/library#library-category-${category.key}"]`).click();
for (const type of category.types) {
const tools = page.locator(`[data-module-type="${type}"] .module-content`);
await expect(tools.first()).toBeVisible();
for (const tool of await tools.all()) {
await expect(tool.getByText("Chargement de l'outil...")).toHaveCount(0);
await expect(tool.locator(":scope > *").first()).toBeVisible();
}
}
}
expect(errors).toEqual([]);
});

View file

@ -90,6 +90,32 @@ test("creates, edits and deletes a weekly calendar event", async ({ page }) => {
await expect(calendar.getByRole("button", { name: /Raid E2E modifié/ })).toHaveCount(0);
});
test("updates weekly and monthly calendar drafts when extending a selection", async ({ page }) => {
await createToolbox(page, "Calendar selection E2E");
await addTool(page, "Calendrier");
const weekly = moduleByType(page, "calendar").first();
await weekly.getByRole("button", { name: "Hebdomadaire" }).click();
await weekly.getByRole("button", { name: /Afficher l'ajout de Calendrier/ }).click();
const slots = weekly.locator(".calendar-day-column").first().locator(".calendar-slot");
await slots.nth(21).dispatchEvent("pointerdown", { buttons: 1 });
await slots.nth(18).dispatchEvent("pointerover", { buttons: 1 });
await slots.nth(18).dispatchEvent("pointerup", { buttons: 0 });
await expect(weekly.getByRole("textbox", { name: "Début" })).toHaveValue("09:00");
await expect(weekly.getByRole("textbox", { name: "Fin" })).toHaveValue("11:00");
await addTool(page, "Calendrier");
const monthly = moduleByType(page, "calendar").last();
await monthly.getByRole("button", { name: "Mensuel" }).click();
await monthly.getByRole("button", { name: /Afficher l'ajout de Calendrier/ }).click();
const days = monthly.locator(".calendar-month-cell:not(.is-outside)");
await days.nth(4).dispatchEvent("pointerdown", { buttons: 1 });
await days.nth(2).dispatchEvent("pointerover", { buttons: 1 });
await expect(monthly.locator(".calendar-month-cell.is-selected")).toHaveCount(3);
await days.nth(2).dispatchEvent("pointerup", { buttons: 0 });
await expect(monthly.locator(".calendar-event-form")).toBeVisible();
await expect(monthly.locator(".calendar-month-cell.is-form-selected")).toHaveCount(3);
});
test("creates a goal tree checklist with more than three visible lines", async ({ page }) => {
await createToolbox(page, "Goal Tree E2E Toolbox");
await addTool(page, "Arbre d'objectifs");