fix: 인게임 내용 폰트를 Pretendard로 통일
게임 프론트 전역에서 Pretendard를 한 번 로드하고 본문·기록·표·입력·버튼의 명시적 글꼴을 공통 토큰으로 통일한다. production Chromium 검증과 정적 회귀 검사를 함께 추가한다.
This commit is contained in:
@@ -179,6 +179,15 @@ const installMainFixture = async (page: Page, failRecords = false) => {
|
||||
myNation: 1,
|
||||
});
|
||||
}
|
||||
if (operation === 'public.getMapLayout') return response(fixture.game.mapLayout);
|
||||
if (operation === 'public.getCachedMap') {
|
||||
return response({ ...fixture.game.map, history: cachedHistory });
|
||||
}
|
||||
if (operation === 'public.getWorldTrend') {
|
||||
return response({ year: 200, month: 1, turnTerm: 10 });
|
||||
}
|
||||
if (operation === 'public.getNationList') return response([]);
|
||||
if (operation === 'public.getGeneralList') return response([]);
|
||||
if (operation === 'turns.getCommandTable') return response({ general: [], nation: [] });
|
||||
if (operation === 'turns.reserved.getGeneral') return response([]);
|
||||
if (operation === 'messages.getRecent') return response(emptyMessages);
|
||||
@@ -265,6 +274,40 @@ test('shows the current in-game map and all three recent record streams', async
|
||||
}
|
||||
});
|
||||
|
||||
test('uses the shared content font for public game history on desktop and mobile', async ({ page }) => {
|
||||
await installMainFixture(page);
|
||||
|
||||
for (const viewport of [
|
||||
{ width: 1200, height: 900 },
|
||||
{ width: 500, height: 900 },
|
||||
]) {
|
||||
await page.setViewportSize(viewport);
|
||||
await page.goto(gameUrl('/public'));
|
||||
await expect(page.locator('.recent-log-list')).toContainText('유비가 촉을 건국하였습니다.');
|
||||
|
||||
const font = await page.locator('.recent-log-list').evaluate((element) => {
|
||||
const style = getComputedStyle(element);
|
||||
return { family: style.fontFamily, size: style.fontSize };
|
||||
});
|
||||
expect(font.family).toContain('Pretendard');
|
||||
expect(font.size).toBe('14px');
|
||||
|
||||
const pretendardFont = await page.evaluate(async () => {
|
||||
await document.fonts.load('400 14px Pretendard', '유비가 촉을 건국하였습니다.');
|
||||
await document.fonts.ready;
|
||||
const statuses = [...document.fonts]
|
||||
.filter((face) => face.family.replaceAll('"', '') === 'Pretendard')
|
||||
.map((face) => face.status);
|
||||
return {
|
||||
statuses,
|
||||
koreanGlyphsLoaded: document.fonts.check('400 14px Pretendard', '유비가 촉을 건국하였습니다.'),
|
||||
};
|
||||
});
|
||||
expect(pretendardFont.statuses).toContain('loaded');
|
||||
expect(pretendardFont.koreanGlyphsLoaded).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test('keeps the current map visible when the recent record request fails', async ({ page }) => {
|
||||
await installMainFixture(page, true);
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
|
||||
Reference in New Issue
Block a user