refactor: compose shared scenario event and item packs

This commit is contained in:
Hide_D committed 2026-07-30 02:27:27 +00:00
1 parent b0b40b87aa
commit 971661338f
82 files changed
+756 -2924

No files matched your search

@@ -244,3 +244,21 @@ describeDb('scenario database seed', () => {
}
});
});
describe('tracked scenario composition', () => {
test('loads the shared event and buyable unique extensions', async () => {
const standard = await loadScenarioDefinitionById(1010);
const expanded = await loadScenarioDefinitionById(2141);
const mixedConst = await loadScenarioDefinitionById(2904);
expect(standard.events).toHaveLength(1);
expect(standard.initialEvents).toHaveLength(1);
expect(expanded.events).toHaveLength(7);
expect(expanded.initialEvents).toHaveLength(1);
expect(expanded.config.const.availableSpecialWar).toHaveLength(20);
expect(Object.keys(expanded.config.const.allItems as object)).toEqual(['horse', 'weapon', 'book', 'item']);
expect(mixedConst.config.const.scenarioEffect).toBe('event_StrongAttacker');
expect(mixedConst.config.const.availableSpecialWar).toEqual(expanded.config.const.availableSpecialWar);
expect(mixedConst.config.const.allItems).toEqual(expanded.config.const.allItems);
});
});