Allow fresh Advanced native No-Field placement
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 20:09:52 +11:00
1 parent 9ca68c9ff8
commit 26d45ecf25
13 files changed
+201 -21

No files matched your search

+24 -3
View File
@@ -65,15 +65,17 @@ void test('Advanced deployed marker can select native Homeworld without exposing
assert.deepEqual(view, before);
});
void test('Basic return and fresh Advanced supply placement cannot target the native World', () => {
void test('Basic return remains unavailable while fresh Advanced supply can target the native World', () => {
const basic = fixture(false);
assert.doesNotMatch(destinations(markup(basic)), /value="homeworld:richese"/);
assert.equal(options.richeseHomeworldMarkerChoice(basic, 'homeworld:richese', 'five', 0, 'homeworld:atreides').action, null);
const fresh = fixture(true);
fresh.richeseNoField!.private = createRicheseNoField(['zero', 'three', 'five']);
fresh.richeseNoField!.canShip = true;
assert.doesNotMatch(destinations(markup(fresh)), /value="homeworld:richese"/);
assert.equal(options.richeseHomeworldMarkerChoice(fresh, 'homeworld:richese', 'five', 0).action, null);
assert.match(destinations(markup(fresh)), /value="homeworld:richese"/);
assert.deepEqual(options.richeseHomeworldMarkerChoice(fresh, 'homeworld:richese', 'five', 0).action,
{ type:'homeworldShip', event:'homeworld-event', destination:'homeworld:richese', sources:{},
noField:'five', noFieldEvent:'marker-event', allyPayment:0 });
});
type Element = ReactElement<{ children?: ReactNode; [key: string]: unknown }>;
@@ -119,4 +121,23 @@ void test('the marker control sends the selected native return through the norma
assert.deepEqual(JSON.parse(JSON.stringify(sent[0])), { type: 'homeworldShip', event: 'homeworld-event',
destination: 'homeworld:richese', sources: {}, noField: 'five', noFieldEvent: 'marker-event',
allyPayment: 0, noFieldFrom: 'homeworld:atreides' });
// A fresh placement must clear companions chosen for a foreign target:
// native reserves already occupy the destination and must not be charged.
view.richeseNoField!.private = createRicheseNoField(['zero', 'three', 'five']);
view.richeseNoField!.canShip = true;
states.length = 0;
sent.length = 0;
const companion = render().find(element => element.type === 'input' && element.props.type === 'number');
assert.ok(companion);
(companion.props.onChange as (event: {target: {value: string}}) => void)({target:{value:'2'}});
const freshSelect = render().find(element => element.type === 'select' && element.props['aria-label'] === 'No-Field destination Homeworld');
assert.ok(freshSelect);
(freshSelect.props.onChange as (event: {target: {value: string}}) => void)({target:{value:'homeworld:richese'}});
assert.ok(!render().some(element => element.type === 'input' && element.props.type === 'number'));
const freshButton = render().find(element => element.type === 'button');
assert.ok(freshButton && freshButton.props.disabled === false);
(freshButton.props.onClick as () => void)();
assert.deepEqual(JSON.parse(JSON.stringify(sent[0])), { type:'homeworldShip', event:'homeworld-event',
destination:'homeworld:richese', sources:{}, noField:'zero', noFieldEvent:'marker-event', allyPayment:0 });
});