feat: 메인에 자율행동 설정을 표시한다

Ref와 Gateway의 옵션 순서와 유효 기간 문구를 따라 8열 마지막 셀에 상태를 더한다.\n활성 상태의 hover와 keyboard focus에서 상세 tooltip을 보이고, 비활성 상태는 표준으로 표시한다.
This commit is contained in:
2026-08-27 16:37:47 +00:00
parent 68870be5e5
commit 9e5e580134
5 changed files with 193 additions and 1 deletions
@@ -78,6 +78,7 @@ type NavigationFixture = {
messages?: unknown;
messageContacts?: unknown;
autorunLimit?: number | null;
autorunUser?: { limitMinutes: number; options: string[] } | null;
dashboardResponses?: Array<{
bytes: number;
contextKind: string | null;
@@ -633,6 +634,7 @@ const installFixture = async (page: Page, state: NavigationFixture) => {
clockStartsAt: state.clockStartsAt ?? null,
turnEngineRunning: state.turnEngineRunning === undefined ? true : state.turnEngineRunning,
scenarioTitle: state.scenarioTitle ?? '',
autorunUser: state.autorunUser ?? null,
});
}
if (operation === 'dashboard.getContextBundleDelta') {
@@ -1370,6 +1372,62 @@ test('the private-message notice moves a mobile reader to the private section',
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(500);
});
test('main info fills the eighth slot with Ref-compatible autorun status and an accessible detail tooltip', async ({
page,
}, testInfo) => {
const state: NavigationFixture = {
officerLevel: 5,
permission: 2,
nationLevel: 3,
stage: 0,
npcMode: 1,
autorunUser: {
limitMinutes: 1_440,
options: ['chief', 'battle', 'train', 'recruit', 'recruit_high', 'warp', 'develop'],
},
generalMeCalls: 0,
operations: [],
};
await installFixture(page, state);
await page.setViewportSize({ width: 1200, height: 900 });
await waitForMain(page);
const gameInfo = page.locator('.legacy-game-info');
const status = page.locator('[data-main-autorun-status]');
const tooltip = page.getByRole('tooltip', {
name: '내정, 순간이동, 모병, 훈련/사기진작, 출병, 사령턴, 24시간 유효',
});
await expect(gameInfo.locator(':scope > *')).toHaveCount(8);
await expect(status).toHaveText(/ : /u);
await expect(status).toHaveAttribute('tabindex', '0');
await expect(tooltip).toBeHidden();
const desktopBefore = await gameInfo.boundingBox();
await status.hover();
await expect(tooltip).toBeVisible();
await expect(tooltip).toHaveText('내정, 순간이동, 모병, 훈련/사기진작, 출병, 사령턴, 24시간 유효');
expect(await status.evaluate((element) => getComputedStyle(element).overflow)).toBe('visible');
expect(await gameInfo.boundingBox()).toEqual(desktopBefore);
await page.screenshot({ path: testInfo.outputPath('main-autorun-hover-desktop-1200.png'), fullPage: false });
await page.setViewportSize({ width: 500, height: 900 });
await status.focus();
await expect(tooltip).toBeVisible();
expect(await status.evaluate((element) => getComputedStyle(element).overflow)).toBe('visible');
const mobileTooltip = await tooltip.boundingBox();
expect(mobileTooltip?.x).toBeGreaterThanOrEqual(16);
expect(mobileTooltip ? mobileTooltip.x + mobileTooltip.width : Infinity).toBeLessThanOrEqual(484);
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBe(500);
await page.screenshot({ path: testInfo.outputPath('main-autorun-focus-mobile-500.png'), fullPage: false });
state.autorunUser = null;
await page.reload();
await waitForMain(page);
await expect(status).toHaveText('기타 설정: 표준');
await expect(status).not.toHaveAttribute('tabindex', '0');
await expect(page.getByRole('tooltip')).toHaveCount(0);
});
test('desktop menus preserve ref columns, prefix-safe routes, and controlled dropdown behavior', async ({
page,
}, testInfo) => {