Support Atreides special Karama truth commitments
Verify and publish checkpoint container / container (push) Successful in 10m46s
Verify and publish checkpoint container / container (push) Successful in 10m46s
This commit is contained in:
1 parent
add8e1d51a
commit
5079ab556f
16 files changed
+408
-19
No files matched your search
@@ -101,3 +101,29 @@ void test('the Emperor special source rejects other respondents and forged turns
|
||||
forged.mixed.action.source = JSON.stringify(['karamaEmperorSpecial', game.turn + 1, f.target]);
|
||||
reject(game, f.asker, { type: 'truthAsk', question: forged });
|
||||
});
|
||||
|
||||
void test('Emperor special guide uses its own promise event after an earlier unrelated whole-turn answer', () => {
|
||||
const f = fixture();
|
||||
// Both original Truthtrances were dealt to the asker by the native fixture.
|
||||
let game = declareTruthRevival(f, f.game, { copies: 2 }).game;
|
||||
game = act(game, f.asker, { type: 'truthAsk', question: {
|
||||
kind: 'turnActions', target: f.target, turn: game.turn,
|
||||
mixed: { kind: 'action', action: { kind: 'cardPlay', effect: 'hajr' } },
|
||||
} });
|
||||
assert.ok(viewGame(game, f.target).truthTurnActionAnswers?.includes('no'));
|
||||
game = act(game, f.target, { type: 'truthAnswer', answer: 'no' });
|
||||
assert.equal(game.truthtrance?.stage, 'ask');
|
||||
game = act(game, f.asker, { type: 'truthAsk', question: question(f) });
|
||||
assert.ok(viewGame(game, f.target).truthTurnActionAnswers?.includes('yes'));
|
||||
game = act(game, f.target, { type: 'truthAnswer', answer: 'yes' });
|
||||
const rows = game.turnActionPromises!.filter(row => row.player === f.target && !row.fulfilled && !row.released);
|
||||
assert.equal(rows.length, 2);
|
||||
const special = rows.find(row => row.windowCards?.karamaEmperorSpecial); assert.ok(special);
|
||||
const guide = viewGame(game, f.target).turnActionGuide; assert.ok(guide);
|
||||
assert.equal(guide.event, special.event);
|
||||
assert.equal(guide.action.turnActionPromiseEvent, special.event);
|
||||
assert.equal(guide.action.mode, 'special');
|
||||
game = act(game, f.target, guide.action);
|
||||
assert.ok(game.turnActionPromises!.find(row => row.event === special.event)?.fulfilled);
|
||||
assert.deepEqual(inventory(settle(game)), f.originalCards);
|
||||
});
|
||||
Reference in new issue
Block a user