Reveal the Stardust pack in the shop, keep the campaign expiry row inside its card and stabilise the Aniimo e2e tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
99724cb6ba
commit
2c10df0370
7 changed files with 65 additions and 27 deletions
|
|
@ -424,3 +424,7 @@
|
|||
{"id":"int-f1bbb5962129c7674787c28da46ea650","kind":"field_change","created_at":"2026-11-19T11:36:41.25317937Z","actor":"Shinuwa","issue_id":"sokko-g-3jc.25","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Filtre Toutes / En cours / Terminées au-dessus de la liste des campagnes."}}
|
||||
{"id":"int-dee0cbbf6858323ae43e72f1aa67d679","kind":"field_change","created_at":"2026-11-19T11:36:58.453086604Z","actor":"Shinuwa","issue_id":"sokko-g-3jc.24","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Bouton Dupliquer : même nom, récompense, limite et durée ; le code reste à choisir."}}
|
||||
{"id":"int-1857e3ebc7948285b6758eeba3938ff0","kind":"field_change","created_at":"2026-11-19T11:43:01.755017215Z","actor":"Shinuwa","issue_id":"sokko-g-3jc.22","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Ouvertures sur 7 jours (dont offertes) affichées sur chaque tuile de collection."}}
|
||||
{"id":"int-88e114bc80ec0a15b6396e4511647109","kind":"field_change","created_at":"2026-11-19T12:11:41.541867041Z","actor":"Shinuwa","issue_id":"sokko-g-fl5l","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fermé à la demande de Shinuwa, sans changement."}}
|
||||
{"id":"int-6d631c5019cc81e56c330e0cfd5f2366","kind":"field_change","created_at":"2026-11-19T12:14:35.221624035Z","actor":"Shinuwa","issue_id":"sokko-g-b41l","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"La ligne de prolongation passe à la ligne ; l'e2e vérifie que la carte ne déborde pas à 768 px."}}
|
||||
{"id":"int-7fd9f0691d058f3334cd6da25ebb2450","kind":"field_change","created_at":"2026-11-19T12:28:23.465964929Z","actor":"Shinuwa","issue_id":"sokko-g-q9ee","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"openAniimos attend la première carte avec 30 s de marge et le fichier passe à 60 s par test : 108/108 à 16 workers (23 échecs avant), suite e2e complète 211/211."}}
|
||||
{"id":"int-3da6fd11192ef9377fdc58c614654864","kind":"field_change","created_at":"2026-11-19T12:34:38.867433432Z","actor":"Shinuwa","issue_id":"sokko-g-t8qd","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Le paquet Poussières d'étoiles se révèle dans la boutique ; Retour ramène aux articles de la boutique."}}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,13 @@ import { test, expect } from "@playwright/test";
|
|||
|
||||
const route = "/#/games/aniimo/aniimos";
|
||||
const cards = (page) => page.locator(".aniimo-result");
|
||||
// Sous la charge d'une suite complète, le premier affichage (module différé et catalogue servis par Vite) dépasse
|
||||
// souvent les 5 s des assertions : chaque visite attend la première carte avec une marge, puis les tests gardent leurs attentes courantes.
|
||||
async function openAniimos(page) {
|
||||
await page.goto(route);
|
||||
await expect(cards(page).first()).toBeVisible({ timeout: 30000 });
|
||||
}
|
||||
test.describe.configure({ timeout: 60000 });
|
||||
const filterTrigger = (page, name) => page.getByRole("button", { name: new RegExp(`^${name}`) });
|
||||
const filterMenu = (page, name) => page.getByRole("dialog", { name: new RegExp(`^${name}`) });
|
||||
async function openFilter(page, name) {
|
||||
|
|
@ -14,7 +21,7 @@ async function openFilter(page, name) {
|
|||
|
||||
test("role and element menus use two columns and highlight their condition", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
const roles = await openFilter(page, "Rôles");
|
||||
await expect(roles).toHaveAttribute("data-columns", "2");
|
||||
expect(await roles.locator(".nds-filter-menu-options").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.split(" ").length)).toBe(2);
|
||||
|
|
@ -32,11 +39,10 @@ test("role and element menus use two columns and highlight their condition", asy
|
|||
|
||||
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);
|
||||
await openAniimos(page);
|
||||
const prismana = page.getByRole("button", { name: "Prismana uniquement", exact: true });
|
||||
await expect(prismana).toBeVisible({ timeout: 30000 });
|
||||
await expect(prismana).toBeVisible();
|
||||
await expect(prismana).toHaveAttribute("aria-pressed", "false");
|
||||
await prismana.focus();
|
||||
await prismana.press("Space");
|
||||
|
|
@ -70,7 +76,6 @@ for (const width of [1280, 390]) {
|
|||
}
|
||||
|
||||
test("Aniimo matches MHW card motion, surfaces and filter controls", async ({ page }) => {
|
||||
test.setTimeout(45000);
|
||||
async function styles(locator, properties) {
|
||||
return locator.evaluate((element, keys) => {
|
||||
const css = globalThis.getComputedStyle(element);
|
||||
|
|
@ -95,7 +100,7 @@ test("Aniimo matches MHW card motion, surfaces and filter controls", async ({ pa
|
|||
const face = await styles(page.locator(".mhwilds-card-front").first(), faceProperties);
|
||||
const indicator = await styles(page.locator(".mhwilds-flip-indicator").first(), indicatorProperties);
|
||||
const filter = await styles(page.locator(".filter-logic"), filterProperties);
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await openFilter(page, "Éléments");
|
||||
const card = cards(page).first();
|
||||
await expect(card).toBeVisible();
|
||||
|
|
@ -151,7 +156,7 @@ test("Aniimo exposes its regions list", async ({ page }) => {
|
|||
});
|
||||
|
||||
test("tabs, flip, matching variants and reset remain independent", async ({ page }) => {
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await page.getByRole("searchbox").fill("emberpup");
|
||||
const card = cards(page).first();
|
||||
await expect(card.getByRole("tab")).toHaveCount(3);
|
||||
|
|
@ -182,7 +187,7 @@ 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);
|
||||
await openAniimos(page);
|
||||
const abilities = await openFilter(page, "Compétences de logis");
|
||||
const carry = page.locator("#aniimo-minimum-carry");
|
||||
const crafting = page.locator("#aniimo-minimum-crafting");
|
||||
|
|
@ -244,7 +249,7 @@ test("ability levels use independent native ranges and retain name constraints",
|
|||
});
|
||||
|
||||
test("seven tabs support keyboard navigation and fall back after filtering", async ({ page }) => {
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await page.getByRole("searchbox").fill("iris");
|
||||
const card = cards(page).filter({ has: page.getByRole("heading", { name: "Iris", exact: true }) });
|
||||
await expect(card.getByRole("tab")).toHaveCount(7);
|
||||
|
|
@ -283,7 +288,7 @@ for (const width of [1280, 390]) {
|
|||
test(`uniform cards, visible variant tabs and scrollable backs at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 844 });
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await expect(cards(page)).toHaveCount(120);
|
||||
const sizes = await page.locator(".aniimo-card").evaluateAll((elements) => elements.map((element) => {
|
||||
const { width, height } = element.getBoundingClientRect();
|
||||
|
|
@ -350,7 +355,7 @@ for (const width of [1280, 390]) {
|
|||
test("portrait geometry, stable faces and mobile layout", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await page.getByRole("searchbox").fill("emberpup");
|
||||
const card = cards(page).first();
|
||||
await card.scrollIntoViewIfNeeded();
|
||||
|
|
@ -384,7 +389,7 @@ test("portrait geometry, stable faces and mobile layout", async ({ page }) => {
|
|||
|
||||
test("desktop grid uses the width freed by horizontal filters and shows complete stats", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1920, height: 1080 });
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await expect(cards(page)).toHaveCount(120);
|
||||
const columns = await page.locator(".aniimo-grid").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.split(" ").length);
|
||||
expect(columns).toBe(6);
|
||||
|
|
@ -397,7 +402,7 @@ test("desktop grid uses the width freed by horizontal filters and shows complete
|
|||
});
|
||||
|
||||
test("advanced filter menus retain selections, counts and keyboard closing", async ({ page }) => {
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
const roles = await openFilter(page, "Rôles");
|
||||
await expect(roles.getByRole("checkbox", { name: "SOIN", exact: true })).toHaveCount(1);
|
||||
await expect(roles.getByRole("checkbox", { name: "SOUTIEN", exact: true })).toHaveCount(1);
|
||||
|
|
@ -443,7 +448,7 @@ test("pending and failed data requests show loading and error states", async ({
|
|||
for (const width of [768, 1440]) {
|
||||
test(`regional filters preserve identities, keyboard access and combinations at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await expect(cards(page)).toHaveCount(120);
|
||||
const catalogueRegions = await cards(page).evaluateAll((items) => items.map((item) => item.dataset.region));
|
||||
expect(catalogueRegions.slice(0, -9)).not.toContain("special");
|
||||
|
|
@ -500,7 +505,7 @@ test("incomplete Aniimo cards show unknown roles and missing portraits without f
|
|||
catalogue.find((aniimo) => aniimo.name === "hoptail").variations[0].image = null;
|
||||
await route.fulfill({ response, json: catalogue });
|
||||
});
|
||||
await page.goto(route);
|
||||
await openAniimos(page);
|
||||
await page.getByRole("searchbox").fill("jabster");
|
||||
await expect(cards(page)).toHaveCount(1);
|
||||
await cards(page).getByRole("button", { name: /Afficher les capacités/ }).click();
|
||||
|
|
|
|||
|
|
@ -1416,6 +1416,10 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
await expect(dragonCampaign).toContainText("0 / 1 utilisés");
|
||||
await expect(dragonCampaign).toContainText("Personne n’a encore utilisé ce code.");
|
||||
await noOverflow();
|
||||
// À 768 px, la prolongation (date, heure, case, bouton) passe à la ligne au lieu de sortir de la carte.
|
||||
await page.setViewportSize({ width: 768, height: 1000 });
|
||||
await expect(dragonCampaign.getByRole("button", { name: "Changer l’expiration" })).toBeVisible();
|
||||
expect(await dragonCampaign.evaluate((element) => element.scrollWidth - element.clientWidth)).toBeLessThanOrEqual(0);
|
||||
|
||||
// Le filtre sépare les campagnes en cours des campagnes terminées (révoquées, expirées ou épuisées).
|
||||
const campaignFilter = page.getByRole("group", { name: "Afficher les campagnes" });
|
||||
|
|
@ -1558,13 +1562,14 @@ test("players give cards and answer trade proposals from two accounts", async ({
|
|||
await expect(partner.getByRole("dialog").locator('[data-selected]')).toHaveCount(1);
|
||||
await partner.getByRole("dialog").getByRole("button", { name: "Fermer", exact: true }).click();
|
||||
|
||||
// Le paquet de la boutique s'achète en poussière, s'ouvre aussitôt et n'est jamais proposé dans Paquets.
|
||||
// Le paquet de la boutique s'achète en poussière, s'ouvre aussitôt dans la boutique et n'est jamais proposé dans Paquets.
|
||||
await partner.goto("/#/cards/packs");
|
||||
await expect(partner.locator(".nebula-pack")).toHaveCount(2);
|
||||
await partner.goto("/#/cards/shop");
|
||||
const packItem = partner.locator('.nebula-shop-item[data-item="pack"]');
|
||||
await packItem.getByRole("button", { name: "Acheter et ouvrir" }).click();
|
||||
await expect(partner).toHaveURL(/#\/cards\/packs$/);
|
||||
await expect(partner.getByRole("heading", { name: "Révélez vos trois cartes" })).toBeVisible();
|
||||
await expect(partner).toHaveURL(/#\/cards\/shop$/);
|
||||
await expect(partner.getByRole("heading", { name: "Révélez vos trois cartes" })).toBeVisible();
|
||||
await expect(partner.locator(".nebula-card-back img").first()).toHaveAttribute("src", "/static/img/cards/stardust/back.webp");
|
||||
await expect(partner.locator(".nebula-opening-odds")).toContainText("50 % des légendaires et mythiques tirées viennent de Poussières d'étoiles");
|
||||
|
|
@ -1573,7 +1578,9 @@ test("players give cards and answer trade proposals from two accounts", async ({
|
|||
// Ce paquet se paie en poussière : il ne propose pas de continuer sur une ouverture.
|
||||
await expect(partner.getByRole("button", { name: "Ouvrir un autre paquet de la même collection", exact: true })).toHaveCount(0);
|
||||
await partner.getByRole("button", { name: "Retour", exact: true }).click({ timeout: 30_000 });
|
||||
await partner.goto("/#/cards/shop");
|
||||
// « Retour » ramène aux articles de la boutique, sans passer par Paquets.
|
||||
await expect(partner).toHaveURL(/#\/cards\/shop$/);
|
||||
await expect(packItem).toBeVisible();
|
||||
await expect(partner.locator(".nebula-shop-wallet")).toContainText("440");
|
||||
// Plusieurs ouvertures d'un coup : le maximum suit la poussière (440 au prix affiché), la saisie y est ramenée.
|
||||
const openingItem = partner.locator('.nebula-shop-item[data-item="opening"]');
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ export function CardsPage({ siteContent, cardsConfig, playerSection = "", player
|
|||
{section === "expeditions" && <ExpeditionsPanel {...panelProps} content={{ ...content.expeditions, cardSheet: content.cardSheet }} joinId={decodeURIComponent(playerSubsection)} />}
|
||||
{section === "packs" && <PackPanel {...panelProps} content={content.packs} reserveContent={content.home} />}
|
||||
{section === "collection" && <CollectionPanel {...panelProps} headingContent={content.collection} recyclingContent={content.recycling} onStartTransfer={startTransfer} />}
|
||||
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} onOpenPacks={openPacks} />}
|
||||
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} openingContent={content.packs} />}
|
||||
{section === "transfers" && <TransfersPanel {...panelProps} content={content.transfers} draft={transferDraft} onDraftUsed={clearTransferDraft} />}
|
||||
{section === "history" && <HistoryPanel catalog={catalog} state={state} content={content.history} />}
|
||||
{section === "account" && <AccountPanel state={state} busy={busy || offline} content={content.account} privacy={content.privacy} privacyContact={cardsConfig.privacyContact} privacyController={cardsConfig.privacyController} onDelete={deleteAccount} runMutation={runMutation} />}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,8 @@ function OpeningOdds({ catalog, opening, collection, content, shopShare }) {
|
|||
</section>;
|
||||
}
|
||||
|
||||
function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
|
||||
// Révélation d'une ouverture ; la Boutique l'utilise aussi pour son paquet, qui s'ouvre sans quitter la boutique.
|
||||
export function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
|
||||
const [revealed, setRevealed] = useState(new Set());
|
||||
const [finishedReveals, setFinishedReveals] = useState(new Set());
|
||||
const [completed, setCompleted] = useState(false);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
// Rôle : boutique du joueur ; affiche le solde de poussière d'étoiles, achète des ouvertures de paquet et, quand les Expéditions
|
||||
// sont ouvertes, change la poussière en Éclats d'étoile (Pont des Veilleurs) et vend les objets de la boutique (Parchemin d'oubli,
|
||||
// Rose des vents).
|
||||
import { useState } from "react";
|
||||
import { buyOpening, buyShopItem, buyShopPack, convertStardust } from "./cardsApi.js";
|
||||
import { useRef, useState } from "react";
|
||||
import { buyOpening, buyShopItem, buyShopPack, completeOpening, convertStardust } from "./cardsApi.js";
|
||||
import { DashboardAside } from "./CardsDashboard.jsx";
|
||||
import { CollectionCardBack } from "./CollectionCardBack.jsx";
|
||||
import { EclatsBalance, StardustBalance } from "./Currency.jsx";
|
||||
import { fillTemplate } from "./dailyShare.js";
|
||||
import { formatEclats } from "./expeditionFormat.js";
|
||||
import { OpeningStage } from "./PackPanel.jsx";
|
||||
import { formatStardust } from "./stardustFormat.js";
|
||||
|
||||
|
||||
|
|
@ -96,8 +97,10 @@ function QuantityItem({ id, cover, title, description, quantityLabel, rateLabel,
|
|||
</article>;
|
||||
}
|
||||
|
||||
export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPacks }) {
|
||||
export function ShopPanel({ catalog, state, runMutation, busy, content, openingContent }) {
|
||||
const [notice, setNotice] = useState("");
|
||||
const [completedOpening, setCompletedOpening] = useState(null);
|
||||
const focusOnMount = useRef(false);
|
||||
const { wallet, shop } = state;
|
||||
|
||||
// Les Éclats ne servent qu'aux Expéditions : le Pont n'est proposé que lorsqu'elles sont ouvertes.
|
||||
|
|
@ -106,11 +109,29 @@ export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPa
|
|||
const shopPack = catalog.collections.find((collection) => collection.packCategory === "shop" && collection.active);
|
||||
const packMissing = Math.max(0, shop.shopPackPrice - wallet.stardust);
|
||||
|
||||
// L'ouverture attribuée s'affiche dans la section Paquets, qui gère la révélation.
|
||||
// Le paquet acheté se révèle ici même : « Retour » ramène à la boutique. Une autre ouverture en cours reste dans Paquets.
|
||||
const isShopOpening = (opening) => catalog.collections.find((collection) => collection.id === opening?.collectionId)?.packCategory === "shop";
|
||||
const opening = (isShopOpening(state.pendingOpening) ? state.pendingOpening : null) || completedOpening;
|
||||
if (opening) return <OpeningStage
|
||||
key={opening.id}
|
||||
catalog={catalog}
|
||||
opening={opening}
|
||||
busy={busy}
|
||||
content={openingContent}
|
||||
shopShare={shop.shopPackShare}
|
||||
remaining={{ reserve: state.recharge.openingsBalance, purchased: wallet.purchasedOpenings }}
|
||||
onComplete={async () => {
|
||||
setCompletedOpening(opening);
|
||||
return runMutation(() => completeOpening(opening.id));
|
||||
}}
|
||||
onDismiss={() => setCompletedOpening(null)}
|
||||
focusOnMountRef={focusOnMount}
|
||||
onOpenAnother={null}
|
||||
/>;
|
||||
|
||||
async function buyPack() {
|
||||
setNotice("");
|
||||
const result = await runMutation(() => buyShopPack());
|
||||
if (result?.opening) onOpenPacks();
|
||||
await runMutation(() => buyShopPack());
|
||||
}
|
||||
|
||||
async function buy(count) {
|
||||
|
|
|
|||
|
|
@ -993,7 +993,7 @@ main:has(.nebula-dashboard) { overflow-x: clip; }
|
|||
.nebula-admin-campaign-missing { justify-self: start; margin: 0; }
|
||||
.nebula-admin-campaign-reward { margin: 0; color: var(--color-text-secondary); font-size: var(--font-size-sm); }
|
||||
.nebula-admin-campaign-detail .nebula-admin-actions { align-items: center; margin: 0; }
|
||||
.nebula-admin-extend { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; }
|
||||
.nebula-admin-extend { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); max-width: 100%; margin-left: auto; }
|
||||
.nebula-admin-extend .nds-input { width: 220px; }
|
||||
.nebula-admin-extend .nebula-admin-check, .nebula-admin-extend .nds-button { white-space: nowrap; }
|
||||
.nebula-admin-claims-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue