Décharge conseillée et progression par série (5d) ; journal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-23 06:51:10 +01:00
co-authored by Claude Opus 5.5
parent 74bd0851cb
commit d0aff18d8e
20 changed files with 389 additions and 14 deletions
+26
View File
@@ -624,6 +624,32 @@ function check(scheme, cond, msg) {
ok(/^0:3\d$/.test(await page.locator(".wod-clock__time").textContent() ?? ""), "Barbara : le repos ne compte pas dans le temps");
await page.evaluate(() => localStorage.removeItem("ia-fit.draft"));
// ---- décharge (lot 5d) : conseillée après six semaines, séance allégée, reprise ----
await page.evaluate(async () => {
const { store } = await import("./main.js");
for (let i = 0; i < 6; i++) {
const d = new Date(Date.UTC(2026, 9, 5 + 7 * i)).toISOString().slice(0, 10);
store.dispatch("SessionLogged", { date: d, kind: "strength", ref: "B", name: "Séance B", warmup: null,
exercises: [{ id: "bench-press", name: "Développé couché barre", target: "3 × 8", tracking: "load", loadKg: 50, seconds: null, plannedSets: 3, sets: [{ reps: 8, effort: "ok" }] }] });
}
});
await go("#/");
ok(await page.getByRole("heading", { name: "Une semaine de décharge ?" }).isVisible(), "décharge conseillée après six semaines d'entraînement");
await shot("25-decharge");
await button("Commencer la décharge").click();
await settle();
ok(await page.getByText(/^Décharge · jour 1 sur 7/).isVisible(), "décharge en cours : jour 1 sur 7");
await go("#/seance/B");
const plannedB = await page.evaluate(async () => (await import("./main.js")).store.getState().program.sessions.find((x) => x.key === "B").exercises[0].sets);
const shown = (await page.locator("details.exercise:not(.exercise--warmup) .exercise__sub").first().textContent()) ?? "";
ok(await page.locator(".deload-note").count() >= 1 && shown.startsWith(`${plannedB >= 3 ? plannedB - 1 : plannedB} × `),
`séance : la décharge est annoncée, une série de moins (${plannedB} prévues, « ${shown} »)`);
await go("#/");
await button("Arrêter la décharge").click();
await settle();
ok(await page.evaluate(async () => (await import("./main.js")).store.getState().mode) === "progression", "décharge arrêtée : retour en progression");
await page.evaluate(() => localStorage.removeItem("ia-fit.draft"));
// ---- réinitialisation --------------------------------------------------------------
await go("#/donnees");
await button("Tout effacer").click();