List the Carnets des Veilleurs from legendaries to commons, like every other collection

The Collection shows cards in catalog order, and the Carnets were listed from commons to legendaries. A test now checks that every collection lists its cards from the rarest to the most common, and the card guide states the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-16 15:39:59 +01:00
parent 4d05d812c5
commit 7c393c4a2a
3 changed files with 306 additions and 296 deletions

View file

@ -23,6 +23,16 @@ const destinationIds = destinations.map((destination) => destination.id);
const settings = mergeExpeditionSettings(DEFAULT_EXPEDITION_SETTINGS, destinationIds);
const profile = (bravoure, endurance, fortune, orientation) => ({ bravoure, endurance, fortune, orientation });
// La Collection affiche les cartes dans l'ordre du catalogue : chaque collection va de la plus rare à la plus commune.
test("every collection lists its cards from the rarest to the most common", () => {
const rank = new Map(rawCatalog.rarities.map((rarity, index) => [rarity.id, index]));
const rarityOf = new Map(rawCatalog.editions.map((edition) => [edition.cardId, edition.rarity]));
for (const collection of rawCatalog.collections) {
const ranks = rawCatalog.cards.filter((card) => card.collectionId === collection.id).map((card) => rank.get(rarityOf.get(card.id)));
assert.ok(ranks.every((value, index) => index === 0 || value <= ranks[index - 1]), `${collection.id} : cartes de la plus rare à la plus commune`);
}
});
test("every catalog card carries expedition tags and every collection a profile", () => {
const tagIds = new Set(rawCatalog.expeditionTags.map((tag) => tag.id));
assert.ok(rawCatalog.cards.every((card) => card.expedition.tags.length >= 1 && card.expedition.tags.every((tag) => tagIds.has(tag))));