fix: 플레이 감사 기간을 실제 초기 달력으로 제한

This commit is contained in:
2026-09-16 04:07:56 +00:00
parent 31c5927449
commit 9e14306fe4
8 changed files with 160 additions and 8 deletions
+36
View File
@@ -7,6 +7,7 @@ const world = {
year: 190,
month: 7,
startYear: 190,
startMonth: 1,
serverId: 'audit-fixture',
tick: '100',
asOf: '2026-09-16T00:00:00.000Z',
@@ -474,3 +475,38 @@ test('historical log failure retries independently and sends only the selected m
expect(requests.filter((r) => r.operation === 'playAudit.generalTurns')).toHaveLength(0);
await capture(page, 'historical-general-logs-mobile');
});
test('initial calendar before the scenario year bounds default periods and month controls', async ({ page }) => {
const requests = await install(page);
await page.route(gameTrpcRoute, async (route) => {
if (decodeURIComponent(route.request().url()).includes('playAudit.coverage')) {
await route.fulfill({
contentType: 'application/json',
body: JSON.stringify([
{
result: {
data: {
...world,
year: 189,
month: 10,
startYear: 189,
startMonth: 10,
status: 'COLLECTED',
samples: [],
nextCursor: null,
},
},
},
]),
});
} else await route.fallback();
});
await page.goto(gamePath('/play-audit?tab=nations&nation=2'));
await expect(page.getByLabel('시작 연도', { exact: true })).toHaveValue('189');
await expect(page.getByLabel('시작 월', { exact: true })).toHaveValue('10');
await expect(page.getByLabel('시작 월', { exact: true })).toHaveAttribute('min', '10');
await expect(page.getByLabel('월', { exact: true })).toHaveAttribute('min', '10');
await expect
.poll(() => requests.find((r) => r.operation === 'playAudit.nationSeries')?.input)
.toMatchObject({ from: { year: 189, month: 10 }, to: { year: 189, month: 10 } });
});
+18 -3
View File
@@ -102,7 +102,10 @@ const readQuery = () => {
moment.value = ['month', 'final'].includes(String(route.query.at)) ? String(route.query.at) : 'current';
year.value = numeric(route.query.year, coverage.value?.year ?? 0);
month.value = numeric(route.query.month, coverage.value?.month ?? 1);
const defaultStart = Math.max((coverage.value?.startYear ?? year.value) * 12, year.value * 12 + month.value - 6);
const defaultStart = Math.max(
(coverage.value?.startYear ?? year.value) * 12 + (coverage.value?.startMonth ?? 1) - 1,
year.value * 12 + month.value - 6
);
fromYear.value = numeric(route.query.fromYear, Math.floor(defaultStart / 12));
fromMonth.value = numeric(route.query.fromMonth, (defaultStart % 12) + 1);
resolution.value = route.query.resolution === 'month' ? 'month' : 'halfYear';
@@ -333,7 +336,14 @@ onMounted(async () => {
:max="coverage.year"
required
/></label>
<label>월<input v-model.number="month" type="number" min="1" max="12" required /></label>
<label
>월<input
v-model.number="month"
type="number"
:min="year === coverage.startYear ? coverage.startMonth : 1"
:max="year === coverage.year ? coverage.month : 12"
required
/></label>
<template v-if="tab === 'nations' && moment !== 'final'">
<label
>시작 연도<input
@@ -344,7 +354,12 @@ onMounted(async () => {
required
/></label>
<label
>시작 월<input v-model.number="fromMonth" type="number" min="1" max="12" required
>시작 월<input
v-model.number="fromMonth"
type="number"
:min="fromYear === coverage.startYear ? coverage.startMonth : 1"
:max="fromYear === coverage.year ? coverage.month : 12"
required
/></label>
<label
>간격<select class="legacy-sort-select" v-model="resolution">