Hide closed permanent Sokko TCG collections until the player owns one of their cards
This commit is contained in:
parent
70233312d3
commit
ecc2040352
3 changed files with 9 additions and 9 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue