fix: 세력일람에 군주 현재 위치를 복원

영토가 없는 세력도 전체 도시 사전에서 군주의 위치를 찾아 Ref와 같은 현재 위치를 표시한다. API와 Chromium 회귀 테스트를 추가한다.
This commit is contained in:
2026-08-27 10:08:39 +00:00
parent cb5d94a440
commit 9078291e19
4 changed files with 85 additions and 14 deletions
+28 -2
View File
@@ -200,7 +200,8 @@ const install = async (
mode: 'general' | 'no-general' | 'error-after-load' = 'general',
accessPages: string[] = [],
requestedOperations: string[] = [],
directoryRows = generals
directoryRows = generals,
nationDirectoryRows = nationDirectory
) => {
let generalDirectoryCalls = 0;
await page.addInitScript((profile) => {
@@ -249,7 +250,7 @@ const install = async (
return response({ myGeneral: mode === 'no-general' ? null : { id: 1, name: '조회자' } });
}
if (operation === 'join.getConfig') return response({});
if (operation === 'world.getNationDirectory') return response(nationDirectory);
if (operation === 'world.getNationDirectory') return response(nationDirectoryRows);
if (operation === 'public.recordAccess') {
const payload = requestBody?.[String(operationIndex)];
const pageName = payload?.json?.page ?? payload?.page;
@@ -322,6 +323,31 @@ const installAccessBoundary = async (page: Page, accessPages: string[]) => {
});
};
test('a level-zero nation shows the ruler current city even without territory there', async ({ page }) => {
const roamingNation = {
...nationDirectory[0]!,
id: 3,
name: '방랑군',
level: 0,
capitalCityId: 0,
cityCount: 0,
officers: Array.from({ length: 8 }, (_, index) => ({
officerLevel: 12 - index,
general: index === 0 ? { id: 40, name: '방랑군주', npcState: 0, cityId: 2 } : null,
})),
rulerCityName: '성도',
cities: [],
generals: [{ id: 40, name: '방랑군주', npcState: 0 }],
};
await install(page, 'general', [], [], generals, [roamingNation]);
await page.goto('nation-list');
const table = page.locator('[data-nation-id="3"]');
await expect(table).toContainText('현재 위치 : 성도');
await expect(table.locator('.roaming-city')).toHaveCSS('color', 'rgb(255, 255, 0)');
});
test('PYA-scale general directory mounts only the active responsive layout and defers portraits', async (
{ page },
testInfo
@@ -51,10 +51,6 @@ const displayAmbassadorName = (nation: Nation, name: string) => {
return general ? displayGeneralName(general) : name;
};
const roamingCityName = (nation: Nation): string => {
const chief = officerName(nation, 12);
return nation.cities.find((city) => city.id === chief?.cityId)?.name ?? '-';
};
const closeWindow = () => window.close();
const officerLevelAt = (row: number, column: number, columns: number) => 13 - ((row - 1) * columns + column);
@@ -275,7 +271,8 @@ onBeforeUnmount(() => {
</template>
</template>
<template v-else
>현재 위치 : <span class="roaming-city">{{ roamingCityName(nation) }}</span></template
>현재 위치 :
<span class="roaming-city">{{ nation.rulerCityName ?? '-' }}</span></template
>
</td>
</tr>