Connect independent-card battle and arrival reactions
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-28 22:34:39 +11:00
1 parent 4d769af8c7
commit 6719245f40
10 files changed
+464 -9

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { applyAction, viewGame } from '../game/engine';
import { actIndependentOrdinary as act, createIndependentOrdinaryFixture as fixture,
independentOrdinaryInventory as inventory, independentOrdinaryPlayer as player } from './fixture-semuta-independent-ordinary';
import { SEMUTA_DRUG_ID } from '../game/semuta-drug';
void test('an older pending ordinary discard continues without creating a new Semuta offer', () => {
const f = fixture('hajr');
const played = act(f.game, f.owner, f.play);
assert.ok(played.pendingTreacheryDiscard?.reaction);
const saved = structuredClone(played);
delete saved.pendingTreacheryDiscard!.reaction;
assert.equal(viewGame(saved, f.owner).automaticContinuationPending, true);
const resumed = applyAction(saved, f.owner, {type: 'advanceBots'});
assert.equal(resumed.pendingTreacheryDiscard, null);
assert.ok(resumed.hajr.includes(f.owner));
assert.ok(player(resumed, f.holder).hand.some(card => card.id === SEMUTA_DRUG_ID));
assert.equal(resumed.discard.filter(card => card.id === f.card).length, 1);
assert.deepEqual(inventory(resumed), f.originalInventory);
});