Support Harkonnen special Karama truth commitments
Verify and publish checkpoint container / container (push) Successful in 10m17s

This commit is contained in:
Quintine committed 2026-10-29 18:08:04 +11:00
1 parent 15a4f3038a
commit b448144c52
15 files changed
+449 -35

No files matched your search

+39
View File
@@ -2123,3 +2123,42 @@ void test('turn-action answer callbacks reject stale target, source queue, priva
const replaced = { game: answering(), busy: false, act() { assert.fail('Replaced view cannot send'); } };
const old = find(TurnActionAnswers(replaced), 'data-turn-action-answer', 'yes'); replaced.game = { ...replaced.game }; click(old);
});
void test('Harkonnen special Karama authoring uses only its public Bidding opportunity', () => {
const game = auction();
game.advanced = true;
const harkonnen = game.players.find(player => player.id === 'p')!;
const other = game.players.find(player => player.id === 'r')!;
harkonnen.faction = 'harkonnen'; harkonnen.specialKaramaUsed = false; other.faction = 'emperor';
const source = JSON.stringify(['karamaHarkonnenSpecial', game.turn, 'p']);
const initial = windowClaim('karamaHarkonnenSpecial', source);
const e = editor(initial, false, game);
Object.defineProperty(harkonnen, 'hand', { get() { throw Error('Question authoring read private hand'); }, configurable: true });
assert.equal(e.error(), null);
assert.match(e.html(), /Use Harkonnen’s special Karama during Bidding/);
assert.match(e.html(), /Turn 2 · Harkonnen special Karama during Bidding/);
select(e.tree(), '1', 'window-source', ''); assert.ok(e.error());
select(e.tree(), '1', 'window-source', source); assert.equal(e.error(), null);
assert.ok(turnActionInputError(initial, game, 'r'), 'Only Harkonnen is a valid respondent');
harkonnen.specialKaramaUsed = true;
assert.ok(e.error(), 'The completed once-per-game power closes the opportunity');
harkonnen.specialKaramaUsed = false; game.phase = 4;
assert.ok(e.error(), 'The original Bidding window has closed');
});
void test('Harkonnen special Karama guide forwards only the exact live printed-card packet', () => {
const source = JSON.stringify(['karamaHarkonnenSpecial', 2, 'p']);
const game = projected(3, { type: 'card', mode: 'special', card: 'controlled-printed-karama', target: 'r', amount: 1 });
game.advanced = true;
const owner = game.players.find(player => player.id === 'p')!;
const target = game.players.find(player => player.id === 'r')!;
owner.faction = 'harkonnen'; owner.specialKaramaUsed = false; target.faction = 'emperor'; target.handCount = 1;
game.turnActionPromises[0].mixed = windowClaim('karamaHarkonnenSpecial', source);
const sent: Action[] = [], props = { game, busy: false, act(action: Action) { sent.push(action); } };
const button = guide(props);
assert.equal(button.props.disabled, false);
assert.match(renderToStaticMarkup(button), /Harkonnen’s special Karama/);
press(button); assert.deepEqual(sent, [game.turnActionGuide!.action]);
target.handCount = 0; press(button); assert.equal(sent.length, 1);
target.handCount = 1; owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
});