Enable advanced ambassador child arrivals
Verify and publish checkpoint container / container (push) Successful in 10m16s

This commit is contained in:
Quintine committed 2026-10-29 19:42:27 +11:00
1 parent 22b463a395
commit 8a39f5a172
9 files changed
+288 -17

No files matched your search

@@ -7,6 +7,10 @@ import { renderToStaticMarkup } from 'react-dom/server';
import { viewGame, type GameView } from '../game/engine';
import { act, createFremenOverlapFixture, triggerFremen } from './fixture-overlap-fremen-native';
import { createGuildOverlapChildFixture } from './fixture-guild-overlap-child';
import { advancedOverlapChildFixture } from './fixture-advanced-overlap-child';
import { botActions } from '../game/bots';
import { DIFFICULTIES } from '../game/bot-profiles';
import { nextBasicSemutaAmbassadorStep } from './fixture-basic-semuta-ambassador';
const aliases = registerHooks({
resolve(specifier, context, next) {
@@ -64,3 +68,28 @@ void test('Guild overlap exposes the enabled real Ambassador trigger and shipmen
assert.match(selectedHtml, /aria-label="Ambassador reserve shipment"/);
assert.match(selectedHtml, /Ship selected forces for free/);
});
for (const effect of ['fremen', 'guild'] as const) void test(`Advanced ${effect} overlap exposes controls and legal bot choices`, () => {
const f = advancedOverlapChildFixture(effect, 'ambassador');
let offered = act(f.game, f.entrant, f.shipment);
for (let i = 0; i < 30 && !offered.pendingAmbassador; i++) {
const next = nextBasicSemutaAmbassadorStep(offered);
assert.ok(next, 'The original shipment has a legal continuation');
offered = act(offered, next.actor, next.action);
}
const view = viewGame(offered, 'ecaz');
assert.equal(view.ambassadorEntry?.beneficiaries[0].blocked, null);
const html = htmlFor(view);
assert.doesNotMatch(triggerButton(html), /\bdisabled(?:=|\s|>)/);
for (const difficulty of DIFFICULTIES) {
const botView = viewGame(offered, 'ecaz');
botView.players.find(player => player.id === 'ecaz')!.bot = difficulty;
const action = botActions(botView)[0];
assert.ok(action, difficulty);
assert.doesNotThrow(() => act(offered, 'ecaz', action), difficulty);
}
const entry = offered.pendingAmbassador; assert.ok(entry);
const selected = act(offered, 'ecaz', { type:'decision', event:entry.event, trigger:true, beneficiary:'ecaz' });
const selectedHtml = htmlFor(viewGame(selected, 'ecaz'));
assert.match(selectedHtml, effect === 'fremen' ? /aria-label="Ambassador force relocation"/ : /aria-label="Ambassador reserve shipment"/);
});