Make the mythic rarity prismatic, centralize rarity colors and show rarity symbols in the history
Some checks failed
Validate and deploy Sokko G / validate (push) Failing after 20m39s
Validate and deploy Sokko G / deploy (push) Has been skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-24 15:52:20 +01:00
parent 9739189f0c
commit 5a794e5220
11 changed files with 106 additions and 72 deletions

View file

@ -327,8 +327,8 @@ test("player opens and reveals a three-card pack", async ({ page }) => {
const revealedBox = await revealedCards.first().boundingBox();
expect([Math.round(revealedBox.width), Math.round(revealedBox.height)]).toEqual([300, 420]);
expect(await revealedCards.evaluateAll((cards) => cards.map((card) => card.ownerDocument.defaultView.getComputedStyle(card).opacity))).toEqual(["1", "1", "1"]);
await expect(revealedCards.first().locator(".nebula-card-face")).toHaveCSS("border-top-color", "rgb(103, 232, 249)");
await expect(revealedCards.first().locator(".nebula-card-rarity-symbol")).toHaveCSS("color", "rgb(103, 232, 249)");
await expect(revealedCards.first().locator(".nebula-card-face")).toHaveCSS("background-image", /conic-gradient\(from 20deg, rgb\(255, 209, 92\)/);
await expect(revealedCards.first().locator(".nebula-card-rarity-symbol svg")).toHaveCSS("fill", /url\(/);
await expect(revealedCards.first().locator(".nebula-card-particles i").first()).toHaveCSS("color", "rgb(255, 59, 48)");
await expect(page.getByRole("button", { name: "Retour", exact: true })).toBeVisible();
expect(await revealedCards.evaluateAll((cards) => cards.map((card) => card.querySelector(".nebula-card-new-badge")?.textContent === "New"))).toEqual(newEditions);
@ -350,10 +350,10 @@ test("player opens and reveals a three-card pack", async ({ page }) => {
await expect(historyCards).toHaveCount(3);
await expect(historyCards.first().getByRole("img")).toHaveAttribute("aria-label", /^(Commun|Rare|Épique|Légendaire|Mythique)$/);
await expect(historyCards.locator(".nds-badge").filter({ hasText: /· (Commun|Rare|Épique|Légendaire|Mythique)\b/ })).toHaveCount(0);
// La pastille de chaque carte prend la couleur de sa rareté (une légendaire n'a pas la couleur d'une commune).
// Le symbole de chaque carte prend la couleur de sa rareté (une légendaire n'a pas la couleur d'une commune).
expect(await historyCards.evaluateAll((items) => items.every((item) => {
const color = item.ownerDocument.defaultView.getComputedStyle(item.querySelector(".nebula-history-rarity")).backgroundColor;
return color === { common: "rgb(156, 163, 175)", rare: "rgb(59, 130, 246)", epic: "rgb(217, 70, 239)", legendary: "rgb(246, 196, 83)", mythic: "rgb(103, 232, 249)" }[item.dataset.rarity];
const color = item.ownerDocument.defaultView.getComputedStyle(item.querySelector(".nebula-history-rarity")).color;
return color === { common: "rgb(156, 163, 175)", rare: "rgb(59, 130, 246)", epic: "rgb(217, 70, 239)", legendary: "rgb(246, 196, 83)", mythic: "rgb(244, 241, 255)" }[item.dataset.rarity];
}))).toBe(true);
for (const name of revealedNames) await expect(historyCards.filter({ hasText: name }).first()).toBeVisible();
await expect(page.getByText("Cartes à révéler", { exact: true })).toHaveCount(0);
@ -1209,7 +1209,7 @@ test("administrator navigates sections, manages mythic content and previews visu
const mythicPreview = openingEffects.filter({ has: page.locator('[data-opening-effect="mythic-default-opening"]') });
const mythicSurface = mythicPreview.locator(".nebula-card-reveal");
await expect(mythicPreview).not.toContainText("Effet personnalisé");
await expect(mythicSurface).toHaveCSS("--card-rarity", "#67e8f9");
await expect(mythicSurface).toHaveCSS("--card-rarity", "#f4f1ff");
await expect(mythicSurface).toHaveAttribute("data-particle-shape", "sparks");
await expect(mythicSurface).toHaveAttribute("data-particle-palette", "rainbow");
await expect(mythicPreview.getByRole("button", { name: "Forme de particules : Étincelles" })).toBeVisible();