Support multiple named Ghola commitments
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 17:50:08 +11:00
1 parent 6c1530382d
commit bdd5aaf18c
8 files changed
+286 -26

No files matched your search

@@ -40,3 +40,27 @@ void test('the Ghola guide forwards only the current legal card and leader', ()
game.ghola.available = true; game.truthtrance = { stage: 'priority', queue: [], passed: [], question: null } as typeof game.truthtrance;
button.props.onClick(); assert.equal(sent.length, 1);
});
void test('Ghola guide starts the current Box and rejects a stale quote', () => {
const game = projected(), me = game.players.find(player => player.id === 'p')!;
const box = { id: 'box', name: 'Nullentropy Box', kind: 'special' as const, effect: 'nullentropyBox' };
me.hand = [box]; game.nullentropy = { card: box, blocked: null, search: null };
game.gholaLeaderPromiseGuide = { action: { type: 'card', card: box.id } };
const sent: Action[] = [], button = GholaLeaderPromiseGuideButton({ game, busy: false, send(action) { sent.push(action); } });
assert.ok(button); assert.equal(button.props.disabled, false); button.props.onClick();
assert.deepEqual(sent, [game.gholaLeaderPromiseGuide.action]);
game.nullentropy.blocked = 'The search is no longer available.'; button.props.onClick();
assert.equal(sent.length, 1);
});
void test('Ghola guide selects only its current paid Box search card', () => {
const game = projected(), box = { id: 'box', name: 'Nullentropy Box', kind: 'special' as const, effect: 'nullentropyBox' };
const ghola = { id: 'recovered', name: 'Ghola', kind: 'special' as const, effect: 'ghola' };
game.decision = { kind: 'nullentropy', player: 'p' };
game.nullentropy = { card: box, blocked: null, search: { event: 'paid', cards: [ghola] } };
game.gholaLeaderPromiseGuide = { action: { type: 'decision', event: 'paid', card: ghola.id } };
const sent: Action[] = [], button = GholaLeaderPromiseGuideButton({ game, busy: false, send(action) { sent.push(action); } });
assert.ok(button); assert.equal(button.props.disabled, false); button.props.onClick();
assert.deepEqual(sent, [game.gholaLeaderPromiseGuide.action]);
game.nullentropy.search!.cards = []; button.props.onClick(); assert.equal(sent.length, 1);
});