test(game-ui): cover restored detailed map links

This commit is contained in:
2026-08-13 16:41:03 +00:00
parent 082bdc6e32
commit 01383b8449
2 changed files with 22 additions and 14 deletions
+20 -1
View File
@@ -164,6 +164,25 @@ const install = async (
if (operation === 'auth.status') return response({ ok: true }); if (operation === 'auth.status') return response({ ok: true });
if (operation === 'lobby.info') return response({ myGeneral: { id: 1, name: '장수' } }); if (operation === 'lobby.info') return response({ myGeneral: { id: 1, name: '장수' } });
if (operation === 'join.getConfig') return response({}); if (operation === 'join.getConfig') return response({});
if (operation === 'dashboard.getContextBundleDelta') {
return response({
context: {
kind: 'snapshot',
revision: 'AAAAAAAAAAAAAAAAAAAAAA',
data: generalContext,
},
commandTable: {
kind: 'snapshot',
revision: 'BBBBBBBBBBBBBBBBBBBBBB',
data: { general: [], nation: [] },
},
boardAccess: {
kind: 'snapshot',
revision: 'CCCCCCCCCCCCCCCCCCCCCC',
data: { permission: 0, canMeeting: false, canSecret: false },
},
});
}
if (operation === 'general.me') return response(generalContext); if (operation === 'general.me') return response(generalContext);
if (operation === 'world.getMap') return response(mapFixture); if (operation === 'world.getMap') return response(mapFixture);
if (operation === 'turns.getCommandTable') return response({ general: [], nation: [] }); if (operation === 'turns.getCommandTable') return response({ general: [], nation: [] });
@@ -807,7 +826,7 @@ test('a Chromium map click opens the clicked city route and keeps the legacy poi
await install(page); await install(page);
await page.setViewportSize({ width: 1200, height: 900 }); await page.setViewportSize({ width: 1200, height: 900 });
await go(page, ''); await go(page, '');
const cityLink = page.locator('.map-city').first(); const cityLink = page.locator('.city-base').first();
await expect(cityLink).toBeVisible(); await expect(cityLink).toBeVisible();
await cityLink.hover(); await cityLink.hover();
await expect(cityLink).toHaveCSS('cursor', 'pointer'); await expect(cityLink).toHaveCSS('cursor', 'pointer');
@@ -158,14 +158,7 @@ const cityStateStyle = computed(() => ({
class="city-base" class="city-base"
:type="props.selectOnly ? 'button' : undefined" :type="props.selectOnly ? 'button' : undefined"
:to="props.selectOnly ? undefined : { name: 'current-city', query: { cityId: props.city.id } }" :to="props.selectOnly ? undefined : { name: 'current-city', query: { cityId: props.city.id } }"
:class="[ :class="[{ mine: props.city.isMyCity, selected: props.city.selected, 'supply-off': !props.city.supply }]"
{
mine: props.city.isMyCity,
selected: props.city.selected,
'supply-off': !props.city.supply,
'select-only': props.selectOnly,
},
]"
:style="cityBaseStyle" :style="cityBaseStyle"
@mouseenter="emit('hover', props.city.id)" @mouseenter="emit('hover', props.city.id)"
@mouseleave="emit('leave')" @mouseleave="emit('leave')"
@@ -195,17 +188,13 @@ const cityStateStyle = computed(() => ({
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
font-size: 0.65rem; font-size: 0.65rem;
color: #fff; color: #fff;
cursor: auto; cursor: pointer;
text-decoration: none; text-decoration: none;
padding: 0; padding: 0;
border: 0; border: 0;
background: transparent; background: transparent;
} }
.city-base.select-only {
cursor: pointer;
}
.city-bg { .city-bg {
position: absolute; position: absolute;
background-position: center; background-position: center;