모바일 장수 정보 묶음과 숫자 가독성 및 의병 표기 개선
This commit is contained in:
@@ -234,6 +234,7 @@ const measure = async (page: Page, root: string, table: string, name: string) =>
|
||||
rect: rect(row),
|
||||
cells: Array.from(row.querySelectorAll('td'), (cell) => ({
|
||||
field: cell.dataset.field,
|
||||
label: getComputedStyle(cell, '::before').content,
|
||||
gridArea: getComputedStyle(cell).gridArea,
|
||||
rect: rect(cell),
|
||||
text: cell.innerText.replace(/\s+/g, ''),
|
||||
@@ -276,6 +277,12 @@ for (const [route, root, table] of [
|
||||
await page.setViewportSize({ width: 1000, height: 900 });
|
||||
await page.goto(route);
|
||||
const desktop = await measure(page, root, table, `${route.replace('/', '-')}-1000`);
|
||||
const firstGeneral = page.locator(`${table} tbody tr`).first();
|
||||
await expect(firstGeneral.locator('[data-field="crew"]')).toHaveText('12,345');
|
||||
if (route === 'nation/secret') {
|
||||
await expect(firstGeneral.locator('[data-field="gold"]')).toHaveText('123,456,789');
|
||||
await expect(firstGeneral.locator('[data-field="rice"]')).toHaveText('234,567');
|
||||
}
|
||||
for (const width of [500, 501, 800]) {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
const mobile = await measure(page, root, table, `${route.replace('/', '-')}-${width}`);
|
||||
@@ -293,6 +300,18 @@ for (const [route, root, table] of [
|
||||
for (const row of mobile.rows) {
|
||||
const turns = row.cells.find((cell) => cell.field === 'turns')!;
|
||||
expect(turns.rect.width).toBeCloseTo(166, 0);
|
||||
const train = row.cells.find((cell) => cell.field === 'train')!;
|
||||
const atmos = row.cells.find((cell) => cell.field === 'atmos')!;
|
||||
expect(train.label).toBe('"훈/사"');
|
||||
expect(atmos.label).toBe('"/"');
|
||||
expect(train.rect.y).toBe(atmos.rect.y);
|
||||
expect(train.rect.x + train.rect.width).toBeCloseTo(atmos.rect.x, 1);
|
||||
if (route === 'nation/secret') {
|
||||
const gold = row.cells.find((cell) => cell.field === 'gold')!;
|
||||
const rice = row.cells.find((cell) => cell.field === 'rice')!;
|
||||
expect(gold.rect.width).toBeCloseTo(rice.rect.width, 1);
|
||||
expect(gold.rect.y).toBe(rice.rect.y);
|
||||
}
|
||||
for (const [index, cell] of row.cells.entries()) {
|
||||
const reference = mobile.rows[0]!.cells[index]!;
|
||||
expect(cell.gridArea).toBe(reference.gridArea);
|
||||
|
||||
@@ -126,12 +126,12 @@ const npcColorStates = [0, 1, 2, 4, 5, 6] as const;
|
||||
const npcColorGenerals = npcColorStates.map((npcState) => ({
|
||||
...general,
|
||||
id: 100 + npcState,
|
||||
name: `색상장수${npcState}`,
|
||||
name: `${({ 4: 'ⓖ', 5: '㉥', 6: 'ⓤ' } as Record<number, string>)[npcState] ?? ''}색상장수${npcState}`,
|
||||
npcState,
|
||||
}));
|
||||
const npcColorSecretGenerals = npcColorStates.map((npcState) => ({
|
||||
id: 100 + npcState,
|
||||
name: `색상장수${npcState}`,
|
||||
name: `${({ 4: 'ⓖ', 5: '㉥', 6: 'ⓤ' } as Record<number, string>)[npcState] ?? ''}색상장수${npcState}`,
|
||||
npcState,
|
||||
injury: 0,
|
||||
baseStats: { leadership: 70, strength: 60, intelligence: 50 },
|
||||
@@ -292,6 +292,9 @@ test('NPC general names use the complete Ref palette in secret and nation lists
|
||||
for (const npcState of npcColorStates) {
|
||||
const name = table.locator(`[data-npc-state="${npcState}"] [data-general-name]`);
|
||||
await expect(name).toBeVisible();
|
||||
if (npcState === 4) await expect(name).toHaveText('ⓖ색상장수4');
|
||||
if (npcState === 5) await expect(name).toHaveText('㉥색상장수5');
|
||||
if (npcState === 6) await expect(name).toHaveText('ⓤ색상장수6');
|
||||
if (npcState === 0) {
|
||||
expect(await name.evaluate((element) => (element as HTMLElement).style.color)).toBe('');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user