Charge par série : pyramide, montée en charge gardée pour la fois suivante (R2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
06a00ab3bb
commit
615348fed3
@@ -516,6 +516,44 @@ function check(scheme, cond, msg) {
|
||||
await settle();
|
||||
ok(page.url().endsWith("#/bravo"), "séance de gainage enregistrée");
|
||||
|
||||
// ---- charge par série : une pyramide, saisie série par série, gardée pour la fois suivante ----
|
||||
const rampLink = await page.evaluate(async () => {
|
||||
const { store } = await import("./main.js");
|
||||
const program = structuredClone(store.getState().program);
|
||||
program.sessions.push({ key: "P1", oneOff: true, name: "Pyramide", warmup: [],
|
||||
exercises: [{ ref: "bench-press", sets: 3, reps: "12-8", setReps: ["12", "10", "8"], rest: 0 }] });
|
||||
return "#import-json=" + encodeURIComponent(JSON.stringify({ program, reason: "Une pyramide au développé couché." }));
|
||||
});
|
||||
await go(rampLink);
|
||||
await button("Adopter").click();
|
||||
await settle();
|
||||
await go("#/seance/P1");
|
||||
await page.locator("summary", { hasText: "Développé couché" }).click();
|
||||
const ramp = page.locator("details.exercise[open]").filter({ has: page.locator("summary", { hasText: "Développé couché" }) });
|
||||
ok(/3 × 12 · 10 · 8/.test(await ramp.locator(".exercise__sub").textContent() ?? ""), "pyramide : un objectif par série");
|
||||
await ramp.getByRole("button", { name: /^Série 1/ }).click();
|
||||
ok(await ramp.getByLabel("Charge de la série 1 (kg)").inputValue() === "", "série 1 : charge à saisir");
|
||||
await ramp.getByLabel("Charge de la série 1 (kg)").fill("40");
|
||||
ok(await ramp.locator("output.stepper__value").textContent() === "12", "série 1 : 12 répétitions proposées");
|
||||
await ramp.locator(".effort[data-effort=ok]").click();
|
||||
await ramp.getByRole("button", { name: /^Série 2 à 40 kg/ }).click();
|
||||
for (let i = 0; i < 4; i++) await ramp.getByRole("button", { name: "2,5 kg de plus" }).click();
|
||||
ok(await ramp.getByLabel("Charge de la série 2 (kg)").inputValue() === "50", "série 2 : +4 × 2,5 kg = 50 kg");
|
||||
ok(await ramp.locator("output.stepper__value").textContent() === "10", "série 2 : 10 répétitions proposées");
|
||||
await ramp.locator(".effort[data-effort=ok]").click();
|
||||
await ramp.getByRole("button", { name: /^Série 3/ }).click();
|
||||
await ramp.getByLabel("Charge de la série 3 (kg)").fill("60");
|
||||
await ramp.locator(".effort[data-effort=hard]").click();
|
||||
ok(/40 → 50 → 60 kg/.test(await ramp.locator(".exercise__sub").textContent() ?? "") && await ramp.locator(".work__loads .num").textContent() === "40 → 50 → 60 kg", "pyramide : les trois charges affichées");
|
||||
await shot("23c-charge-par-serie");
|
||||
const kept = await page.evaluate(async () => (await import("./main.js")).store.getState().workingLoads["P1-bench-press"]);
|
||||
ok(JSON.stringify(kept?.setsKg) === "[40,50,60]" && kept?.loadKg === 60, "pyramide gardée pour la fois suivante : " + JSON.stringify(kept));
|
||||
await button("Terminer la séance").click();
|
||||
await settle();
|
||||
ok(page.url().endsWith("#/bravo"), "pyramide enregistrée");
|
||||
const last = await page.evaluate(async () => (await import("./main.js")).store.getState().sessions.find((x) => x.ref === "P1"));
|
||||
ok(JSON.stringify(last?.exercises[0].sets.map((x) => x.kg)) === "[40,50,60]" && last?.exercises[0].loadKg === 60, "séance : la charge de chaque série");
|
||||
|
||||
// ---- WOD de référence (lot 4d) : catalogue, fiche, « Faire aujourd'hui » ----------
|
||||
await go("#/");
|
||||
await page.getByRole("link", { name: /^WOD/ }).click();
|
||||
|
||||
Reference in New Issue
Block a user