검색을 꺼도 턴 대상 상세 목록을 항상 표시
This commit is contained in:
@@ -3618,6 +3618,10 @@ for (const width of [1200, 390]) {
|
||||
let form = picker.getByTestId('command-argument-form');
|
||||
const toggle = form.getByRole('button', { name: '검색 꺼짐', exact: true });
|
||||
await expect(form.locator('input[type=search]')).toHaveCount(0);
|
||||
await expect(form.getByTestId('city-target-list').locator('button')).toHaveCount(3);
|
||||
await form.getByTestId('city-target-list').getByRole('button', { name: /허창/ }).click();
|
||||
await expect(form.locator('#command-arg-destCityId')).toHaveValue('2');
|
||||
await form.screenshot({ path: testInfo.outputPath(`search-off-${width}.png`) });
|
||||
await toggle.click();
|
||||
let input = form.locator('input[type=search]');
|
||||
await expect(input).not.toBeFocused();
|
||||
@@ -3640,6 +3644,7 @@ for (const width of [1200, 390]) {
|
||||
await expect(picker).toBeVisible();
|
||||
await form.getByRole('button', { name: '검색 켜짐', exact: true }).click();
|
||||
await expect(input).toHaveCount(0);
|
||||
await expect(results.locator('button')).toHaveCount(3);
|
||||
await expect(form.locator('#command-arg-destCityId')).toHaveValue('2');
|
||||
await picker.getByRole('button', { name: '입력', exact: true }).click();
|
||||
await expect.poll(() => JSON.stringify(requests)).toContain('"destCityId":2');
|
||||
@@ -3650,6 +3655,8 @@ for (const width of [1200, 390]) {
|
||||
await picker.getByRole('button', { name: /^(?:국가:)?인사$/, exact: true }).click();
|
||||
await picker.getByRole('button', { name: /발령/ }).click();
|
||||
form = picker.getByTestId('command-argument-form');
|
||||
await expect(form.getByTestId('general-target-list').locator('button')).toHaveCount(3);
|
||||
await expect(form.getByTestId('city-target-list').locator('button')).toHaveCount(3);
|
||||
await form.getByRole('button', { name: '검색 꺼짐', exact: true }).click();
|
||||
const generalSearch = form.locator('#command-search-destGeneralId');
|
||||
const citySearch = form.locator('#command-search-destCityId');
|
||||
@@ -3709,6 +3716,9 @@ for (const width of [1200, 390]) {
|
||||
await input.press('Escape');
|
||||
await expect(input).toHaveValue('');
|
||||
await expect(picker).toBeVisible();
|
||||
await form.getByRole('button', { name: '검색 켜짐', exact: true }).click();
|
||||
await expect(input).toHaveCount(0);
|
||||
await expect(results.locator('button')).toHaveCount(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -363,22 +363,6 @@ const textFieldError = (field: CommandInputField): string => {
|
||||
return '';
|
||||
};
|
||||
|
||||
const OPTION_CARD_COMMANDS = new Set([
|
||||
'che_물자원조',
|
||||
'che_불가침제의',
|
||||
'che_선전포고',
|
||||
'che_종전제의',
|
||||
'che_불가침파기제의',
|
||||
'che_포상',
|
||||
'che_발령',
|
||||
'che_몰수',
|
||||
'che_부대탈퇴지시',
|
||||
]);
|
||||
const showOptionCards = (field: CommandInputField): boolean =>
|
||||
field.kind === 'select' &&
|
||||
Boolean(field.optionSource && ['nations', 'generals'].includes(field.optionSource)) &&
|
||||
OPTION_CARD_COMMANDS.has(props.commandKey);
|
||||
|
||||
const isValid = computed(() =>
|
||||
props.fields.every((field) => {
|
||||
const value = values[field.key];
|
||||
@@ -640,7 +624,7 @@ watch(
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="showOptionCards(field) || (searchEnabled && isSearchable(field))"
|
||||
v-if="isSearchable(field)"
|
||||
class="target-option-list"
|
||||
:class="{ 'assignment-target-list': commandKey === 'che_발령' && field.optionSource === 'generals' }"
|
||||
:data-testid="
|
||||
|
||||
Reference in New Issue
Block a user