Expand recognized Truthtrance fact questions
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 04:34:29 +11:00
1 parent 8ae275f598
commit 9dd386ff7a
11 files changed
+279 -16

No files matched your search

+15 -2
View File
@@ -8,7 +8,7 @@ import { knowledgeGame } from './truthtrance-knowledge-fixture';
/** Actual native game and Truthtrance actions, with the target's scalar
* spice staged to show both personalized result branches. */
function pending(spice: number): Game {
function pending(spice: number, text = 'Do you have at least 5 spice?'): Game {
let game = knowledgeGame();
game.players.find(player => player.id === 'b')!.spice = spice;
const card = game.players[0].hand.find(item => item.effect === 'truthtrance');
@@ -19,7 +19,7 @@ function pending(spice: number): Game {
assert.ok(voter); game = applyAction(game,voter.id,{type:'truthPass'});
}
return applyAction(game,'a',{type:'truthAsk',question:{kind:'freeform',target:'b',
scope:'fact',text:'Do you have at least 5 spice?'}});
scope:'fact',text}});
}
function markup(game: Game, seat: string) {
return renderToStaticMarkup(createElement(Truthtrance, {game:viewGame(game,seat), busy:false, act() {}}));
@@ -44,3 +44,16 @@ for (const [spice, answer] of [[5,'Yes'],[4,'No']] as const) {
assert.match(observer, /Waiting for .* to answer/);
});
}
void test('a compound freeform shows its aggregate interpretation to the table', () => {
const game = pending(5, 'Do you have at least 5 spice or a Shield?');
const target = markup(game, 'b'), observer = markup(game, 'o');
for (const html of [target, observer]) {
assert.match(html, /Checked as:/);
assert.match(html, /you currently hold at least 5 spice/);
assert.match(html, /OR/);
assert.match(html, /Shield/);
}
assert.match(target, /<strong>Yes<\/strong>/);
assert.doesNotMatch(observer, /Your current game information establishes:/);
});