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

@ -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 });