Connect staged group Nexus negotiations
Verify and publish checkpoint container / container (push) Successful in 10m24s

This commit is contained in:
Quintine committed 2026-10-28 23:04:40 +11:00
1 parent 4798a3579b
commit 624f95dde4
9 files changed
+348 -14

No files matched your search

+17
View File
@@ -8,6 +8,7 @@ import { applyAction, viewGame, type Game } from '../game/engine';
import { nexusOfferGame } from './fixture-nexus-offer';
import { botActions } from '../game/bots';
import { DIFFICULTIES } from '../game/bot-profiles';
import { coalitionOf, emptyCoalitionState } from '../game/coalition-alliance';
const aliases = registerHooks({
resolve(specifier, context, next) {
@@ -26,6 +27,22 @@ function markup(g: Game, id = 'a', busy = false) {
return renderToStaticMarkup(createElement(GameTable, { game: viewGame(g, id), busy, send: async () => {}, onExit() {} }));
}
void test('staged group mode renders its real Nexus invitation and hides conflicting pair controls', () => {
let game = nexusOfferGame();
game.coalitionState = emptyCoalitionState();
game = applyAction(game, 'a', {type: 'alliance', target: 'e'});
game = applyAction(game, 'e', {type: 'alliance', target: 'a'});
const pair = coalitionOf(game.players, game.coalitionState, 'a'); assert.ok(pair);
assert.match(markup(game, 'a'), /Invite Harkonnen observer to Atreides offerer, Emperor recipient/);
game = applyAction(game, 'a', {type: 'coalitionPropose', groupId: pair.id,
entrant: 'h', expectedRevision: game.coalitionState!.revision});
const html = markup(game, 'h');
assert.match(html, /Accept invitation/);
assert.match(html, /Decline and cancel invitation/);
assert.doesNotMatch(html, /Propose \/ accept alliance/);
assert.match(markup(game, 'h', true), /disabled=""[^>]*>Accept invitation/);
});
void test('live outgoing offer is named and withdrawable only by its sender, separately from an incoming invitation', () => {
const g = applyAction(nexusOfferGame(), 'a', { type: 'alliance', target: 'e' });
const html = markup(g);