Link guide cards to checklists and refine Aniimo ability filters
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s

This commit is contained in:
Shinuwa 2026-09-24 23:55:06 +02:00
parent b5901b31e3
commit 7b23a8601a
23 changed files with 193 additions and 51 deletions

View file

@ -149,9 +149,16 @@ test("tabs, flip, matching variants and reset remain independent", async ({ page
test("ability levels use independent native ranges and retain name constraints", async ({ page }) => {
await page.goto(route);
const abilities = section(page, "Compétences de logis");
const carry = page.getByRole("slider", { name: "Porter — Niveau minimum" });
const crafting = page.getByRole("slider", { name: "Artisanat — Niveau minimum" });
const carry = page.locator("#aniimo-minimum-carry");
const crafting = page.locator("#aniimo-minimum-crafting");
await expect(abilities.getByRole("checkbox")).toHaveCount(0);
await expect(abilities.getByRole("button", { name: "OU", exact: true })).toHaveCount(0);
const minimumLevel = abilities.getByRole("button", { name: "Niveau minimum", exact: true });
const exactLevel = abilities.getByRole("button", { name: "Niveau exact", exact: true });
await expect(minimumLevel).toHaveAttribute("aria-pressed", "true");
await expect(exactLevel).toHaveAttribute("aria-pressed", "false");
await expect(carry).toHaveAccessibleName("Porter — Niveau minimum");
await expect(crafting).toHaveAccessibleName("Artisanat — Niveau minimum");
await expect(carry).toHaveValue("0");
await expect(carry).toHaveAttribute("min", "0");
await carry.focus();
@ -165,7 +172,10 @@ test("ability levels use independent native ranges and retain name constraints",
await crafting.press("ArrowRight");
await expect(crafting).toHaveValue("2");
await expect(crafting).toHaveCSS("outline-style", "solid");
await abilities.getByRole("button", { name: "OU", exact: true }).click();
await exactLevel.click();
await expect(exactLevel).toHaveAttribute("aria-pressed", "true");
await expect(minimumLevel).toHaveAttribute("aria-pressed", "false");
await expect(carry).toHaveAccessibleName("Porter — Niveau exact");
await expect(section(page, "Éléments").getByRole("button", { name: "ET", exact: true })).toHaveAttribute("aria-pressed", "true");
await carry.press("Home");
await crafting.press("Home");
@ -173,6 +183,9 @@ test("ability levels use independent native ranges and retain name constraints",
await expect(cards(page)).toHaveCount(88);
await page.getByRole("searchbox").fill("does-not-exist");
await expect(page.getByRole("heading", { name: "Aucun résultat" })).toBeVisible();
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
await expect(minimumLevel).toHaveAttribute("aria-pressed", "true");
await expect(exactLevel).toHaveAttribute("aria-pressed", "false");
});
test("seven tabs support keyboard navigation and fall back after filtering", async ({ page }) => {

View file

@ -126,6 +126,7 @@ test("Aniimo copies visible species or forms and round-trips through checklist i
for (const width of [1280, 390]) {
test(`drawer linking, live completion and session restoration at ${width}px`, async ({ page }) => {
test.setTimeout(60000);
await page.setViewportSize({ width, height: 900 });
await seed(page);
await page.goto(route);
@ -164,11 +165,22 @@ for (const width of [1280, 390]) {
await page.screenshot({ path: test.info().outputPath("linked-drawer.png") });
await closeDrawer(page);
await expect(card).toHaveAttribute("data-checklist-complete", "true");
await expect(card.locator(".aniimo-front .guide-checklist-mark")).toHaveAccessibleName("Coché");
await expect(card.locator(".aniimo-front .guide-checklist-mark")).toHaveCount(0);
await card.getByRole("button", { name: /Afficher les capacités/ }).click();
await expect(card.locator(".aniimo-back .guide-checklist-mark")).toHaveAccessibleName("Coché");
await card.getByRole("button", { name: /Afficher le portrait/ }).click();
const cardCheckbox = card.getByRole("checkbox", { name: "Décocher dans la checklist" });
await expect(cardCheckbox).toBeChecked();
await cardCheckbox.uncheck();
await expect(card).not.toHaveAttribute("data-checklist-complete", "true");
await expect(card.locator(".aniimo-back")).toHaveAttribute("aria-hidden", "true");
await expect.poll(async () => (await readModule(page, "forms")).items.find((item) => item.label.includes("Forme de base")).qtyCurrent || 0).toBe(0);
await card.getByRole("checkbox", { name: "Cocher dans la checklist" }).check();
await expect(card).toHaveAttribute("data-checklist-complete", "true");
await toggleHidden(page);
await expect(card.getByRole("tab")).toHaveCount(2);
await expect(card).toHaveAttribute("data-form", "mountain_woods_form");
expect(await readModule(page, "forms")).toEqual(before);
expect(normalizeChecklistData(await readModule(page, "forms")).items).toEqual(normalizeChecklistData(before).items);
await choose(page, "capture");
await assertLink(page, "capture", true);
await expect(card.getByRole("tab")).toHaveCount(3);
@ -214,6 +226,13 @@ for (const [gameId, category, cardClass, dataPath, dataKey] of [
const count = await page.locator(cardClass).count();
await choose(page, "progress");
await expect(page.locator(`${cardClass}[data-checklist-complete="true"]`)).toHaveCount(1);
const completedCard = page.locator(`${cardClass}[data-checklist-complete="true"]`);
const cardCheckbox = completedCard.getByRole("checkbox", { name: "Décocher dans la checklist" });
await expect(cardCheckbox).toBeChecked();
await cardCheckbox.uncheck();
await expect(page.locator(`${cardClass}[data-checklist-complete="true"]`)).toHaveCount(0);
await page.locator(cardClass).first().getByRole("checkbox", { name: "Cocher dans la checklist" }).check();
await expect(page.locator(`${cardClass}[data-checklist-complete="true"]`)).toHaveCount(1);
await toggleHidden(page);
await expect(page.locator(cardClass)).toHaveCount(count - 1);
await page.setViewportSize({ width: 390, height: 844 });