diff --git a/packages/logic/test/scenarios/blankStart.test.ts b/packages/logic/test/scenarios/blankStart.test.ts index cd543d5..afe1ddf 100644 --- a/packages/logic/test/scenarios/blankStart.test.ts +++ b/packages/logic/test/scenarios/blankStart.test.ts @@ -162,16 +162,15 @@ describe('Blank Start Scenario', () => { if (city) { // Manually update nationId in city const cityIdx = world.snapshot.cities.findIndex(c => c.id === city.id); - const cityToUpdate = world.snapshot.cities[cityIdx]; - if (cityToUpdate) cityToUpdate.nationId = newNationId; + world.snapshot.cities[cityIdx] = { ...world.snapshot.cities[cityIdx], nationId: newNationId }; } const genIdx = world.snapshot.generals.findIndex(g => g.id === generalAfter.id); - const genToUpdate = world.snapshot.generals[genIdx]; - if (genToUpdate) { - genToUpdate.nationId = newNationId; - genToUpdate.meta = { ...generalAfter.meta, founding: false }; - } + world.snapshot.generals[genIdx] = { + ...world.snapshot.generals[genIdx], + nationId: newNationId, + meta: { ...generalAfter.meta, founding: false } + }; } // 5. Verify diff --git a/packages/logic/test/testEnv.ts b/packages/logic/test/testEnv.ts index e925dbe..b03d438 100644 --- a/packages/logic/test/testEnv.ts +++ b/packages/logic/test/testEnv.ts @@ -200,6 +200,9 @@ export class TestGameRunner { year: this.currentDate.getFullYear(), month: this.currentDate.getMonth() + 1, season: Math.floor(this.currentDate.getMonth() / 3), + map: this.world.snapshot.map, + unitSet: this.world.snapshot.unitSet, + cities: this.world.snapshot.cities, ...cmd.context };