Add a Prismana-only filter with a rainbow star icon
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s

This commit is contained in:
Shinuwa 2026-09-24 08:38:31 +02:00
parent 14f1b79cbc
commit 2255de94a7
9 changed files with 69 additions and 1 deletions

View file

@ -5,6 +5,38 @@ const route = "/#/games/aniimo/aniimos";
const cards = (page) => page.locator(".aniimo-result");
const section = (page, name) => page.getByRole("group", { name, exact: true }).filter({ has: page.locator("legend") });
for (const width of [1280, 390]) {
test(`Prismana filter combines with search and survives grouping and navigation at ${width}px`, async ({ page }) => {
test.setTimeout(45000);
await page.setViewportSize({ width, height: 900 });
await page.goto(route);
const prismana = page.getByRole("checkbox", { name: "Prismana uniquement", exact: true });
await expect(prismana).toBeVisible({ timeout: 30000 });
await expect(prismana).not.toBeChecked();
await prismana.focus();
await prismana.press("Space");
await expect(cards(page)).toHaveCount(27);
await expect(page.locator('.aniimo-result:not([data-form="prismana_form"])')).toHaveCount(0);
await expect(page.getByRole("tablist")).toHaveCount(0);
expect(await page.locator('img[src="/static/icons/prismana.svg"]').evaluate((image) => image.complete && image.naturalWidth > 0)).toBe(true);
await page.getByRole("searchbox").fill("iris");
await expect(cards(page)).toHaveCount(3);
await page.locator('.game-breadcrumb a[href="#/games/aniimo"]').click();
await page.locator('a[href="#/games/aniimo/aniimos"]').click();
await expect(prismana).toBeChecked();
await expect(cards(page)).toHaveCount(3);
await page.getByRole("button", { name: "Regrouper les variantes", exact: true }).click();
await expect(cards(page)).toHaveCount(3);
await page.getByRole("searchbox").fill("emberpup");
await expect(page.getByRole("heading", { name: "Aucun résultat" })).toBeVisible();
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
await expect(prismana).not.toBeChecked();
await expect(cards(page)).toHaveCount(208);
await expect(page.getByRole("button", { name: "Regrouper les variantes", exact: true })).toHaveAttribute("aria-pressed", "false");
expect(await page.evaluate(() => globalThis.document.documentElement.scrollWidth <= globalThis.innerWidth)).toBe(true);
});
}
test("Aniimo matches MHW card motion, surfaces and filter controls", async ({ page }) => {
test.setTimeout(45000);
async function styles(locator, properties) {