WOD : séance à format, chrono et score (lot 4b, ADR 0010)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 14:51:56 +01:00
co-authored by Claude Opus 5.5
parent d9604d43ec
commit ee3f55a515
21 changed files with 887 additions and 13 deletions
+32
View File
@@ -379,6 +379,38 @@ function check(scheme, cond, msg) {
await settle();
ok(await monday.getByRole("button", { name: "Faite" }).isVisible(), "lundi : de nouveau à faire");
// ---- WOD (lot 4b) : séance à format, chrono, score ------------------------------
const wodLink = await page.evaluate(async () => {
const { store } = await import("./main.js");
const program = structuredClone(store.getState().program);
program.sessions.push({ key: "W", name: "Mini Fran", format: { type: "fortime", capMinutes: 2 }, warmup: [],
exercises: [{ ref: "barbell-thruster", sets: 1, reps: "21-15-9", rest: 0, note: "RX 43 kg / 29 kg" }, { ref: "kipping-pull-up", sets: 1, reps: "21-15-9", rest: 0 }] });
return "#import-json=" + encodeURIComponent(JSON.stringify({ program, reason: "Un WOD pour essayer." }));
});
await go(wodLink);
await button("Adopter").click();
await settle();
await go("#/seance/W");
ok(await page.locator(".wod-format__label").textContent() === "For Time · cap 2 min", "WOD : format affiché");
ok(await page.locator(".wod-move").count() === 2, "WOD : deux mouvements");
await button("Terminer la séance").click();
ok(/temps/.test(await page.locator(".status").textContent() ?? ""), "WOD : score exigé avant d'enregistrer");
await button("Démarrer").click();
ok(await page.locator(".wod-clock__phase").textContent() === "Prêt ?", "WOD : compte à rebours");
await page.clock.fastForward(5000 + 42000);
await page.waitForTimeout(300);
ok(await page.locator(".wod-clock__phase").textContent() === "Chrono · cap 2 min" && /^0:4\d$/.test(await page.locator(".wod-clock__time").textContent() ?? ""), "WOD : chrono lancé, il monte");
await shot("23-wod", true);
await button("Fini !").click();
const wodTime = await page.locator("#wod-time").inputValue();
ok(/^0:4\d$/.test(wodTime), "WOD : temps relevé au « Fini » : " + wodTime);
await button("Scaled").click();
await button("Terminer la séance").click();
await settle();
ok(page.url().endsWith("#/bravo"), "WOD : séance enregistrée");
await go("#/historique");
ok(await page.getByText(`WOD · ${wodTime} · Scaled`).first().isVisible(), "WOD : score dans l'historique");
// ---- réinitialisation --------------------------------------------------------------
await go("#/donnees");
await button("Tout effacer").click();