Matériel coché dans le profil, bibliothèque « ce que mon matériel permet » (5a)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-23 02:12:25 +01:00
co-authored by Claude Opus 5.5
parent 938d6cf198
commit 72adffb613
15 changed files with 281 additions and 20 deletions
+15 -1
View File
@@ -292,9 +292,14 @@ function check(scheme, cond, msg) {
// ---- profil et mode ----------------------------------------------------------------
await go("#/profil");
await page.getByLabel("Objectif").fill("Prendre de la force sans me blesser");
await page.getByLabel("Matériel").fill("Barre\nBanc\nHaltères");
ok(await page.getByText("Pas encore renseigné").isVisible(), "matériel : pas encore renseigné");
await button("Salle complète").click();
await button("Barre de traction").click();
ok(await button("Barre de traction").getAttribute("aria-pressed") === "false" && await button("Banc", { exact: true }).getAttribute("aria-pressed") === "true", "matériel coché : salle complète sans barre de traction");
await page.getByLabel("Autre matériel").fill("Haltères jusqu'à 30 kg");
await button("Enregistrer le profil").click();
ok(await page.getByText("Profil enregistré.").isVisible(), "profil enregistré");
ok(await page.evaluate(async () => (await import("./main.js")).store.getState().profile.kit?.includes("pullup-bar")) === false, "matériel gardé dans le profil");
await button("Maintien").click();
ok(await button("Maintien").getAttribute("aria-pressed") === "true", "mode maintien");
await shot("11-profil", true);
@@ -349,6 +354,15 @@ function check(scheme, cond, msg) {
await page.goBack();
await settle();
ok(page.url().endsWith("?q=pont&zone=lower&muscle=glutes"), "retour : la liste filtrée");
// Matériel coché (lot 5a) : sans barre de traction, plus de tractions.
await go("#/bibliotheque?q=traction");
const before = await page.locator(".lib-results .row").count();
await button("Seulement ce que mon matériel permet").click();
await page.waitForTimeout(200);
ok(page.url().endsWith("#/bibliotheque?q=traction&possible=1"), "« ce que mon matériel permet » dans l'adresse : " + page.url().split("#")[1]);
ok(await page.locator(".lib-results .row").count() < before && await page.getByRole("link", { name: /^Traction/ }).count() === 0, "sans barre de traction : plus de tractions");
await go("#/bibliotheque/pull-up");
ok(await page.getByText("Il te manque : barre de traction.").isVisible(), "fiche : le matériel qui manque");
await go("#/bibliotheque/squat");
ok(await page.getByText(/Fait \d+ fois/).isVisible(), "fiche du squat : historique et lien vers les analyses");
await button(/Demander à mon IA/).click();