Add e2e coverage for calendar event workflow
All checks were successful
Deploy Sokko G / deploy (push) Successful in 16s

This commit is contained in:
Shinuwa 2026-08-24 21:01:29 +02:00
parent 233f81541d
commit 008bb78ac7

View file

@ -18,6 +18,13 @@ async function createToolbox(page, name) {
await expect(page.getByRole("heading", { name })).toBeVisible(); await expect(page.getByRole("heading", { name })).toBeVisible();
} }
async function addTool(page, name) {
await page.getByRole("button", { name: "Ajouter un outil", exact: true }).click();
const addDialog = page.getByRole("dialog", { name: "Ajouter un outil" });
await expect(addDialog).toBeVisible();
await addDialog.getByRole("button", { name }).click();
}
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await resetSokkoStorage(page); await resetSokkoStorage(page);
}); });
@ -29,12 +36,38 @@ test("creates a toolbox and lazy-loads an added tool", async ({ page }) => {
await expect(page.locator("[data-module-type='notepad']")).toBeVisible(); await expect(page.locator("[data-module-type='notepad']")).toBeVisible();
await expect(page.locator("[data-module-type='links']")).toBeVisible(); await expect(page.locator("[data-module-type='links']")).toBeVisible();
await page.getByRole("button", { name: "Ajouter un outil", exact: true }).click(); await addTool(page, "Arbre d'objectifs");
const addDialog = page.getByRole("dialog", { name: "Ajouter un outil" });
await addDialog.getByRole("button", { name: "Arbre d'objectifs" }).click();
await expect(page.locator("[data-module-type='goalTree']")).toBeVisible(); await expect(page.locator("[data-module-type='goalTree']")).toBeVisible();
}); });
test("creates, edits and deletes a weekly calendar event", async ({ page }) => {
await createToolbox(page, "Calendar E2E Toolbox");
await addTool(page, "Calendrier");
const calendar = page.locator("[data-module-type='calendar']");
await expect(calendar).toBeVisible();
await calendar.getByRole("button", { name: "Hebdomadaire" }).click();
await expect(calendar.locator(".calendar-week-grid")).toBeVisible();
await calendar.getByRole("button", { name: /Afficher l'ajout de Calendrier/ }).click();
await calendar.getByLabel("Titre").fill("Raid E2E");
await calendar.getByRole("textbox", { name: "Début" }).fill("18:00");
await calendar.getByRole("textbox", { name: "Fin" }).fill("20:00");
await calendar.getByRole("button", { name: "Ajouter" }).click();
await expect(calendar.getByRole("button", { name: /Raid E2E/ })).toBeVisible();
await calendar.getByRole("button", { name: /Raid E2E/ }).click();
await calendar.getByLabel("Titre").fill("Raid E2E modifié");
await calendar.getByRole("button", { name: "Enregistrer" }).click();
await expect(calendar.getByRole("button", { name: /Raid E2E modifié/ })).toBeVisible();
await expect(calendar.getByRole("button", { name: /Raid E2E$/ })).toHaveCount(0);
await calendar.getByRole("button", { name: /Raid E2E modifié/ }).click();
await calendar.getByRole("button", { name: "Supprimer" }).click();
await expect(calendar.getByRole("button", { name: /Raid E2E modifié/ })).toHaveCount(0);
});
test("creates a game-linked toolbox from the drawer", async ({ page }) => { test("creates a game-linked toolbox from the drawer", async ({ page }) => {
await page.goto("/#/games/mhwilds"); await page.goto("/#/games/mhwilds");
await expect(page.getByRole("heading", { name: /Monster Hunter.*Wilds/ })).toBeVisible(); await expect(page.getByRole("heading", { name: /Monster Hunter.*Wilds/ })).toBeVisible();