Preserve Emperor gift opportunity before bot Extortion
Verify and publish checkpoint container / container (push) Successful in 10m54s
Verify and publish checkpoint container / container (push) Successful in 10m54s
This commit is contained in:
1 parent
a6be17fc5d
commit
7c1f4b4e09
13 files changed
+370
-13
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { applyAction, viewGame } from '../game/engine';
|
||||
import { botActions, runBots } from '../game/bots';
|
||||
import { createSaphoStationPriorityFixture } from './sapho-station-priority-fixture';
|
||||
|
||||
for (const advanced of [false, true]) void test(
|
||||
`${advanced ? 'Advanced' : 'Basic'} Station priority wins over a synthetic competing bot guide`, () => {
|
||||
const fixture = createSaphoStationPriorityFixture(advanced);
|
||||
const initial = fixture.game;
|
||||
const event = initial.saphoStationPriority!.event;
|
||||
const view = viewGame(initial, fixture.first);
|
||||
|
||||
// A supported Station decision normally suppresses turn-action guidance.
|
||||
// Inject a competing projected guide to exercise defensive dispatch order;
|
||||
// this does not claim that the combination occurs in an ordinary game.
|
||||
view.turnActionGuide = {event:'synthetic-guide', action:{type:'ready'}};
|
||||
const action = botActions(view)[0];
|
||||
assert.deepEqual(action, {type:'saphoStationPass', event});
|
||||
const afterPass = applyAction(initial, fixture.first, action);
|
||||
assert.deepEqual(afterPass.saphoStationPriority?.passed, [fixture.first]);
|
||||
assert.deepEqual(afterPass.ecologicalStorm?.queue?.choices, []);
|
||||
assert.equal(viewGame(afterPass, fixture.holder).saphoStationPriority?.canPass, true);
|
||||
|
||||
// Real scheduler behavior is separately checked on the public-start state;
|
||||
// only the fixture's Station placement and card custody were staged.
|
||||
const scheduled = runBots(initial, 12);
|
||||
assert.deepEqual(scheduled.saphoStationPriority?.passed, [fixture.first]);
|
||||
assert.deepEqual(scheduled.ecologicalStorm?.queue?.choices, []);
|
||||
assert.equal(viewGame(scheduled, fixture.holder).saphoStationPriority?.canPass, true);
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user