Show the shop shortfall above the buy button so buttons stay aligned

"Il vous manque … poussières." sat under the button and pushed it below the buttons of the other items in the row. The shortfall and the pending opening notice now come before the button, which stays at the bottom of every card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-19 11:00:33 +01:00
parent e8ec657193
commit 99a438ff1d
2 changed files with 14 additions and 2 deletions

View file

@ -509,6 +509,17 @@ test("player opens and reveals a three-card pack", async ({ page }) => {
await expect(shopPackItem.locator('img[src="/static/img/cards/stardust/back.webp"]')).toBeVisible();
await expect(shopPackItem.getByRole("button", { name: "Acheter et ouvrir" })).toBeDisabled();
await expect(shopPackItem).toContainText("Il vous manque 60 poussières.");
// Le manque s'affiche au-dessus du bouton : les boutons d'une même rangée d'articles restent alignés.
const buyButtons = await page.locator(".nebula-shop-grid .nebula-shop-item-actions > button:last-child").evaluateAll((buttons) => buttons.map((button) => ({
row: Math.round(button.closest(".nebula-shop-item").getBoundingClientRect().top), bottom: Math.round(button.getBoundingClientRect().bottom),
last: button === button.parentElement.lastElementChild
})));
expect(buyButtons.length).toBeGreaterThan(1);
for (const button of buyButtons) {
expect(button.last).toBe(true);
expect(button.bottom).toBe(buyButtons.find((other) => other.row === button.row).bottom);
}
await page.locator(".nebula-shop-grid").screenshot({ path: join(tmpdir(), "sokkog-cards-shop.png") });
// Le solde ne met plus en avant les ouvertures achetées : la boutique est une grille d'articles illustrés.
await expect(page.locator(".nebula-shop-wallet")).not.toContainText("Ouvertures achetées");
// Le solde est sous le menu, et la page se limite à son en-tête et à ses articles.