fix: compute clouds from planned route so destruction cannot leak (review)
This commit is contained in:
@@ -73,4 +73,19 @@ describe('clouds', () => {
|
||||
expect(cloudFor(g, chainPlan(), 99)).toEqual([]);
|
||||
expect(cloudFor(g, { ...chainPlan(), legs: [] }, 1)).toEqual([]);
|
||||
});
|
||||
|
||||
it('a hidden destroyed outcome does not change the cloud shape', () => {
|
||||
const g = chainGalaxy();
|
||||
const intact = chainPlan();
|
||||
intact.routeLanes = [0, 1, 2];
|
||||
intact.startSys = 0;
|
||||
const doomed = chainPlan();
|
||||
doomed.routeLanes = [0, 1, 2];
|
||||
doomed.startSys = 0;
|
||||
doomed.finalOutcome = 'destroyed';
|
||||
doomed.legs = doomed.legs.slice(0, 1); // itinerary truncated at the hidden destruction
|
||||
for (const t of [1, 3, 4.5]) {
|
||||
expect(JSON.stringify(cloudFor(g, doomed, t))).toBe(JSON.stringify(cloudFor(g, intact, t)));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user