Allow group actions after settled Truthtrance
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 00:12:09 +11:00
1 parent 9cc659602c
commit 420943b890
8 files changed
+135 -5

No files matched your search

+48
View File
@@ -101,6 +101,54 @@ void test('two allies fund one ordinary shipment with donor-specific settlement
assert.equal(spiceIncludingEscrow(game), originalSpice);
});
void test('fulfilled and released Truthtrance records leave group shipment funding usable', () => {
for (const history of ['settled', 'prior-turn'] as const) {
const initial = fixture();
initial.bribePromises = [{event:`bribe-${history}`, player:'d', asker:'a',
turn:history === 'prior-turn' ? initial.turn - 1 : initial.turn,
recipient:'c', minimum:1, answer:true, progress:history === 'settled' ? 1 : 0,
...(history === 'settled' ? {fulfilled:true} : {released:true})}];
let game = pledge(initial);
assert.equal(viewGame(game, 'a').coalitionFunding?.incoming.length, 2);
game = finishResponses(send(game, 'a', shipment));
assert.equal(game.players[0].forces['imperial_basin:9'], 3);
assert.equal(remaining(game, 'b'), 1);
assert.equal(remaining(game, 'c'), 1);
assert.deepEqual(game.bribePromises, initial.bribePromises);
conservedForces(game);
}
});
void test('an unreconciled prior-turn commitment blocks group shipment funding', () => {
const game = fixture();
game.bribePromises = [{event:'unreconciled-bribe', player:'d', asker:'a', turn:game.turn - 1,
recipient:'c', minimum:1, answer:true, progress:0}];
assert.equal(viewGame(game, 'a').coalitionFunding, null);
const before = structuredClone(game);
assert.throws(() => send(game, 'b', {type:'coalitionPledge', recipient:'a', amount:4}));
assert.deepEqual(game, before);
});
void test('a live No bribe-expression commitment blocks group shipment funding', () => {
const game = fixture();
game.bribeExpressionPromises = [{event:'live-expression-no', player:'d', asker:'a',
turn:game.turn, claim:{kind:'payment', recipient:'c', minimum:1}, answer:false, progress:[]}];
assert.equal(viewGame(game, 'a').coalitionFunding, null);
const before = structuredClone(game);
assert.throws(() => send(game, 'b', {type:'coalitionPledge', recipient:'a', amount:4}));
assert.deepEqual(game, before);
});
void test('a current unsupported Truthtrance commitment still blocks group shipment funding', () => {
const game = fixture();
game.bribePromises = [{event:'live-bribe', player:'d', asker:'a', turn:game.turn,
recipient:'c', minimum:1, answer:true, progress:0}];
assert.equal(viewGame(game, 'a').coalitionFunding, null);
const before = structuredClone(game);
assert.throws(() => send(game, 'b', {type:'coalitionPledge', recipient:'a', amount:4}));
assert.deepEqual(game, before);
});
void test('fake or insufficient donor contributions reject without payment or arrival', () => {
const game = pledge(fixture());
for (const contributions of [