Hide closed permanent Sokko TCG collections until the player owns one of their cards
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 20m47s
Validate and deploy Sokko G / deploy (push) Successful in 12s

This commit is contained in:
Shinuwa 2026-11-13 10:26:21 +01:00
parent 70233312d3
commit ecc2040352
3 changed files with 9 additions and 9 deletions

View file

@ -42,14 +42,15 @@ test("Sokko TCG uses design system dropdowns instead of native selects", async (
}
});
test("closed event collections stay hidden until the player owns one of their cards", () => {
test("closed collections stay hidden until the player owns one of their cards", () => {
const visibleCatalog = {
collections: [{ id: "open-event", packCategory: "event", active: true }, { id: "closed-event", packCategory: "event", active: false }, { id: "closed-permanent", packCategory: "permanent", active: false }],
cards: [{ id: "event-card", collectionId: "closed-event" }]
cards: [{ id: "event-card", collectionId: "closed-event" }, { id: "permanent-card", collectionId: "closed-permanent" }]
};
const ids = (owned) => visibleCollections(visibleCatalog, new Set(owned)).map((collection) => collection.id);
assert.deepEqual(ids([]), ["open-event", "closed-permanent"]);
assert.deepEqual(ids(["event-card"]), ["open-event", "closed-event", "closed-permanent"]);
assert.deepEqual(ids([]), ["open-event"]);
assert.deepEqual(ids(["event-card"]), ["open-event", "closed-event"]);
assert.deepEqual(ids(["permanent-card"]), ["open-event", "closed-permanent"]);
});
test("the shop pack mixes active collections with its featured cards at the configured share", () => {