From c25397b54453956f7d9da80901137eee4df949ba Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Sun, 23 Aug 2026 09:08:31 +0200 Subject: [PATCH] test(seed): follow the retuned trade-good drop chances Commit 9391645 lowered the three common guaranteed trade goods from a certain drop to 60% and left the rare Charred Raider Insignia at 100%, but the seed test kept asserting 1.0000 for all four and has been failing since. Asserts the real per-item value instead of one shared constant, so the next retune fails on the number that actually changed. Co-Authored-By: Claude Opus 5 --- .../seeds/vertical-slice.seed.spec.ts | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/api/src/database/seeds/vertical-slice.seed.spec.ts b/apps/api/src/database/seeds/vertical-slice.seed.spec.ts index a373796..781a4e4 100644 --- a/apps/api/src/database/seeds/vertical-slice.seed.spec.ts +++ b/apps/api/src/database/seeds/vertical-slice.seed.spec.ts @@ -589,20 +589,28 @@ describe('seedVisibleVerticalSlice', () => { expect(lootTableRepository.rows).toHaveLength(4); expect(lootEntryRepository.rows).toHaveLength(12); - // Every Burned Road enemy guarantees exactly one trade good (spec §5). - const guaranteedTradeGoods: Array<[string, string]> = [ - [ASH_RAT_LOOT_TABLE_ID, ITEM_IDS['ash-pelt']], - [WILD_ROAD_DOG_LOOT_TABLE_ID, ITEM_IDS['tough-hide']], - [ROAD_BANDIT_LOOT_TABLE_ID, ITEM_IDS['bandit-insignia']], - [CHARRED_LOOTER_LOOT_TABLE_ID, ITEM_IDS['charred-raider-insignia']], + // Every Burned Road enemy carries exactly one trade good as its first + // entry (spec §5). The three common ones were retuned from a guaranteed + // drop to 60%; the rare Charred Raider Insignia stayed certain, because a + // 2%-weight encounter that then withholds its reward is just a lost trip. + const tradeGoodDropChances: Array<[string, string, string]> = [ + [ASH_RAT_LOOT_TABLE_ID, ITEM_IDS['ash-pelt'], '0.6000'], + [WILD_ROAD_DOG_LOOT_TABLE_ID, ITEM_IDS['tough-hide'], '0.6000'], + [ROAD_BANDIT_LOOT_TABLE_ID, ITEM_IDS['bandit-insignia'], '0.6000'], + [ + CHARRED_LOOTER_LOOT_TABLE_ID, + ITEM_IDS['charred-raider-insignia'], + '1.0000', + ], ]; - for (const [lootTableId, itemDefinitionId] of guaranteedTradeGoods) { + for (const [lootTableId, itemDefinitionId, dropChance] of + tradeGoodDropChances) { expect(lootEntryRepository.rows).toEqual( expect.arrayContaining([ expect.objectContaining({ lootTableId, itemDefinitionId, - dropChance: '1.0000', + dropChance, minQuantity: 1, maxQuantity: 1, enabled: true,