feat(game-ui): 사령턴 대상 지도를 인자 계약에 연결
도시·국가 선택 필드에서 지도 대상을 자동 판별하고 발령을 제외한 공개 사령턴 13종의 지도 선택과 보조 정보를 Chromium 회귀로 고정한다.
This commit is contained in:
@@ -4,6 +4,7 @@ import test from 'node:test';
|
||||
import {
|
||||
commandArgumentPresentation,
|
||||
presentedCommandKeys,
|
||||
resolveCommandArgumentMapTarget,
|
||||
} from '../src/components/command/commandArgumentPresentation.ts';
|
||||
|
||||
const cityCommands = [
|
||||
@@ -82,3 +83,25 @@ void test('marks the same city and nation target families that Ref renders with
|
||||
assert.equal(commandArgumentPresentation(commandKey).mapTarget, 'capital', commandKey);
|
||||
}
|
||||
});
|
||||
|
||||
void test('derives selection maps from the actual city and nation argument contract', () => {
|
||||
assert.equal(
|
||||
resolveCommandArgumentMapTarget('future_city_command', [
|
||||
{ key: 'target', label: '도시', kind: 'select', required: true, optionSource: 'cities' },
|
||||
]),
|
||||
'city'
|
||||
);
|
||||
assert.equal(
|
||||
resolveCommandArgumentMapTarget('future_nation_command', [
|
||||
{ key: 'target', label: '국가', kind: 'select', required: true, optionSource: 'nations' },
|
||||
]),
|
||||
'nation'
|
||||
);
|
||||
assert.equal(resolveCommandArgumentMapTarget('che_증축', []), 'capital');
|
||||
assert.equal(
|
||||
resolveCommandArgumentMapTarget('future_general_command', [
|
||||
{ key: 'target', label: '장수', kind: 'select', required: true, optionSource: 'generals' },
|
||||
]),
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user