fix(game-ui): 징병 모병 최종 자금을 표시한다
This commit is contained in:
@@ -1908,7 +1908,12 @@ test('uses a Ref-style full recruitment page without horizontal overflow on desk
|
|||||||
expect(desktopGeometry.bodyOverflow).toBe('hidden');
|
expect(desktopGeometry.bodyOverflow).toBe('hidden');
|
||||||
|
|
||||||
const infantry = form.getByRole('button', { name: '보병 선택 가능', exact: true });
|
const infantry = form.getByRole('button', { name: '보병 선택 가능', exact: true });
|
||||||
|
const estimatedGold = infantry.getByRole('status', { name: '보병 예상 자금' });
|
||||||
|
await expect(estimatedGold).toHaveText('673금');
|
||||||
|
await infantry.locator('input[type=number]').fill('100');
|
||||||
|
await expect(estimatedGold).toHaveText('1,035금');
|
||||||
await infantry.getByRole('button', { name: '절반', exact: true }).click();
|
await infantry.getByRole('button', { name: '절반', exact: true }).click();
|
||||||
|
await expect(estimatedGold).toHaveText('363금');
|
||||||
await page.screenshot({ path: testInfo.outputPath('recruitment-desktop.png') });
|
await page.screenshot({ path: testInfo.outputPath('recruitment-desktop.png') });
|
||||||
await picker.getByRole('button', { name: '입력', exact: true }).click();
|
await picker.getByRole('button', { name: '입력', exact: true }).click();
|
||||||
await expect(page.locator('[data-command-scope="general"] .action-column > div').first()).toHaveText(
|
await expect(page.locator('[data-command-scope="general"] .action-column > div').first()).toHaveText(
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ const filledAmount = (crewType: RecruitmentCrewType | null): number => {
|
|||||||
}
|
}
|
||||||
return Math.max(1, props.info.fullLeadership);
|
return Math.max(1, props.info.fullLeadership);
|
||||||
};
|
};
|
||||||
|
const displayedAmount = (crewType: RecruitmentCrewType): number =>
|
||||||
|
crewType.id === selectedCrewTypeId.value ? amount.value : filledAmount(crewType);
|
||||||
|
const estimatedGoldFor = (crewType: RecruitmentCrewType): number =>
|
||||||
|
Math.ceil(displayedAmount(crewType) * crewType.baseCost * goldCoefficient.value);
|
||||||
|
|
||||||
const initialize = () => {
|
const initialize = () => {
|
||||||
showUnavailable.value = Object.fromEntries(props.info.groups.map((group) => [group.armType, false]));
|
showUnavailable.value = Object.fromEntries(props.info.groups.map((group) => [group.armType, false]));
|
||||||
@@ -246,6 +250,9 @@ watch(
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<span>00명</span>
|
<span>00명</span>
|
||||||
|
<output :aria-label="`${crewType.name} 예상 자금`">
|
||||||
|
{{ estimatedGoldFor(crewType).toLocaleString() }}금
|
||||||
|
</output>
|
||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="crew-action" @click.stop>
|
<span class="crew-action" @click.stop>
|
||||||
@@ -393,7 +400,7 @@ watch(
|
|||||||
}
|
}
|
||||||
.amount-panel label {
|
.amount-panel label {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
grid-template-columns: auto minmax(0, 1fr) auto minmax(76px, auto);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.amount-panel input {
|
.amount-panel input {
|
||||||
@@ -402,6 +409,14 @@ watch(
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
.amount-panel output {
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 4px;
|
||||||
|
background: #ddd;
|
||||||
|
color: #303030;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
.crew-action button,
|
.crew-action button,
|
||||||
.submit-recruit {
|
.submit-recruit {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -452,12 +467,7 @@ watch(
|
|||||||
grid-template-columns: auto minmax(0, 1fr) auto 85px;
|
grid-template-columns: auto minmax(0, 1fr) auto 85px;
|
||||||
}
|
}
|
||||||
.mobile-selected-panel output {
|
.mobile-selected-panel output {
|
||||||
box-sizing: border-box;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 4px;
|
|
||||||
background: #ddd;
|
|
||||||
color: #303030;
|
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
.crew-grid {
|
.crew-grid {
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
|
|||||||
Reference in New Issue
Block a user