fix: RESET 자동턴 고급 징병과 중신 옵션 보존
This commit is contained in:
@@ -955,7 +955,7 @@ test('loads server metadata defaults into the reset form and submits them', asyn
|
||||
showImgLevel: 1,
|
||||
tournamentTrig: false,
|
||||
joinMode: 'onlyRandom',
|
||||
autorunUser: { limitMinutes: 720, options: ['develop', 'train'] },
|
||||
autorunUser: { limitMinutes: 720, options: ['develop', 'recruit_high', 'chief'] },
|
||||
},
|
||||
};
|
||||
await installFixture(page, state);
|
||||
@@ -966,6 +966,8 @@ test('loads server metadata defaults into the reset form and submits them', asyn
|
||||
await page.getByText('고급 시나리오 옵션').click();
|
||||
await expect(page.getByTestId('reset-defaults-source')).toContainText('서버의 메타');
|
||||
await expect(page.getByTestId('reset-npc-mode')).toHaveValue('1');
|
||||
await expect(page.getByTestId('reset-autorun-recruit-high')).toBeChecked();
|
||||
await expect(page.getByTestId('reset-autorun-chief')).toBeChecked();
|
||||
await page.getByTestId('request-reset').click();
|
||||
|
||||
await expect
|
||||
@@ -978,7 +980,7 @@ test('loads server metadata defaults into the reset form and submits them', asyn
|
||||
expect(request).toContain('"npcMode":1');
|
||||
expect(request).toContain('"joinMode":"onlyRandom"');
|
||||
expect(request).toContain('"limitMinutes":720');
|
||||
expect(request).toContain('"options":["develop","train"]');
|
||||
expect(request).toContain('"options":["develop","recruit_high","chief"]');
|
||||
});
|
||||
|
||||
test('edits server reset defaults through profile metadata settings', async ({ page }, testInfo) => {
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
normalizeProfileResetDefaults,
|
||||
SYSTEM_PROFILE_RESET_DEFAULTS,
|
||||
type ProfileResetDefaults,
|
||||
type ResetAutorunOption,
|
||||
} from '../utils/resetDefaults';
|
||||
import { directTrpc, trpc } from '../utils/trpc';
|
||||
|
||||
@@ -140,8 +141,10 @@ const form = reactive({
|
||||
autorunDevelop: true,
|
||||
autorunWarp: true,
|
||||
autorunRecruit: true,
|
||||
autorunRecruitHigh: true,
|
||||
autorunTrain: true,
|
||||
autorunBattle: true,
|
||||
autorunChief: true,
|
||||
openAt: '',
|
||||
preopenAt: '',
|
||||
scheduledAt: '',
|
||||
@@ -259,8 +262,10 @@ const applyResetDefaults = (defaults: ProfileResetDefaults) => {
|
||||
form.autorunDevelop = autorunOptions.has('develop');
|
||||
form.autorunWarp = autorunOptions.has('warp');
|
||||
form.autorunRecruit = autorunOptions.has('recruit');
|
||||
form.autorunRecruitHigh = autorunOptions.has('recruit_high');
|
||||
form.autorunTrain = autorunOptions.has('train');
|
||||
form.autorunBattle = autorunOptions.has('battle');
|
||||
form.autorunChief = autorunOptions.has('chief');
|
||||
};
|
||||
|
||||
const loadResetDefaults = async () => {
|
||||
@@ -569,13 +574,15 @@ const loadScenarios = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const selectedAutorunOptions = (): Array<'develop' | 'warp' | 'recruit' | 'train' | 'battle'> => {
|
||||
const options: Array<'develop' | 'warp' | 'recruit' | 'train' | 'battle'> = [];
|
||||
const selectedAutorunOptions = (): ResetAutorunOption[] => {
|
||||
const options: ResetAutorunOption[] = [];
|
||||
if (form.autorunDevelop) options.push('develop');
|
||||
if (form.autorunWarp) options.push('warp');
|
||||
if (form.autorunRecruit) options.push('recruit');
|
||||
if (form.autorunRecruitHigh) options.push('recruit_high');
|
||||
if (form.autorunTrain) options.push('train');
|
||||
if (form.autorunBattle) options.push('battle');
|
||||
if (form.autorunChief) options.push('chief');
|
||||
return options;
|
||||
};
|
||||
|
||||
@@ -1101,8 +1108,24 @@ onBeforeUnmount(() => {
|
||||
<label><input v-model="form.autorunDevelop" type="checkbox" /> 내정</label>
|
||||
<label><input v-model="form.autorunWarp" type="checkbox" /> 이동</label>
|
||||
<label><input v-model="form.autorunRecruit" type="checkbox" /> 징병</label>
|
||||
<label
|
||||
><input
|
||||
v-model="form.autorunRecruitHigh"
|
||||
type="checkbox"
|
||||
data-testid="reset-autorun-recruit-high"
|
||||
/>
|
||||
고급 징병</label
|
||||
>
|
||||
<label><input v-model="form.autorunTrain" type="checkbox" /> 훈련</label>
|
||||
<label><input v-model="form.autorunBattle" type="checkbox" /> 전투</label>
|
||||
<label
|
||||
><input
|
||||
v-model="form.autorunChief"
|
||||
type="checkbox"
|
||||
data-testid="reset-autorun-chief"
|
||||
/>
|
||||
중신</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user