merge: 최신 원격 main을 Vue 드래그 리팩터링에 재통합
This commit is contained in:
@@ -751,7 +751,13 @@ const chiefCenter = {
|
|||||||
npcState: officerLevel === 8 ? 2 : 0,
|
npcState: officerLevel === 8 ? 2 : 0,
|
||||||
turnTime: null,
|
turnTime: null,
|
||||||
revision: 0,
|
revision: 0,
|
||||||
turns: turns(12),
|
turns:
|
||||||
|
officerLevel === 12
|
||||||
|
? [
|
||||||
|
{ index: 0, action: 'che_포상', args: { destGeneralId: 2, isGold: false, amount: 300 } },
|
||||||
|
...turns(11).map((turn) => ({ ...turn, index: turn.index + 1 })),
|
||||||
|
]
|
||||||
|
: turns(12),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1517,6 +1523,36 @@ test('enters general and nation command arguments and sends exact values', async
|
|||||||
expect(Number.parseFloat(geometry.fontSize)).toBeGreaterThanOrEqual(10);
|
expect(Number.parseFloat(geometry.fontSize)).toBeGreaterThanOrEqual(10);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('shows full nation command briefs in every chief card', async ({ page }) => {
|
||||||
|
await install(page);
|
||||||
|
await page.setViewportSize({ width: 1200, height: 900 });
|
||||||
|
await page.goto('/che/chief-center');
|
||||||
|
|
||||||
|
const desktopSummary = page.locator('.layout-desktop .chief-card').first().locator('.row-action').first();
|
||||||
|
await expect(desktopSummary).toHaveText('【관우】 쌀 300 포상');
|
||||||
|
await expect(desktopSummary).toHaveAttribute('title', '【관우】 쌀 300 포상');
|
||||||
|
await page.screenshot({ path: test.info().outputPath('chief-card-command-brief-desktop-1200.png'), fullPage: true });
|
||||||
|
|
||||||
|
await page.setViewportSize({ width: 500, height: 900 });
|
||||||
|
const mobileSummary = page.locator('.chief-overview .chief-card').first().locator('.row-action').first();
|
||||||
|
await expect(mobileSummary).toHaveText('【관우】 쌀 300 포상');
|
||||||
|
await expect(mobileSummary).toHaveAttribute('title', '【관우】 쌀 300 포상');
|
||||||
|
|
||||||
|
const geometry = await mobileSummary.evaluate((element) => {
|
||||||
|
const rect = element.getBoundingClientRect();
|
||||||
|
const card = element.closest<HTMLElement>('.chief-card');
|
||||||
|
if (!card) throw new Error('chief card is missing');
|
||||||
|
return {
|
||||||
|
width: rect.width,
|
||||||
|
cardWidth: card.getBoundingClientRect().width,
|
||||||
|
horizontalOverflow: card.scrollWidth - card.clientWidth,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
expect(geometry.width).toBeLessThanOrEqual(geometry.cardWidth);
|
||||||
|
expect(geometry.horizontalOverflow).toBeLessThanOrEqual(0);
|
||||||
|
await page.screenshot({ path: test.info().outputPath('chief-card-command-brief-mobile-500.png'), fullPage: true });
|
||||||
|
});
|
||||||
|
|
||||||
test('uses a Ref-style full recruitment page without horizontal overflow on desktop or mobile', async ({
|
test('uses a Ref-style full recruitment page without horizontal overflow on desktop or mobile', async ({
|
||||||
page,
|
page,
|
||||||
}, testInfo) => {
|
}, testInfo) => {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const handleClick = () => {
|
|||||||
<div v-for="row in props.rows" :key="row.index" class="chief-row" :class="{ rest: row.isRest }">
|
<div v-for="row in props.rows" :key="row.index" class="chief-row" :class="{ rest: row.isRest }">
|
||||||
<span class="row-index">#{{ row.index + 1 }}</span>
|
<span class="row-index">#{{ row.index + 1 }}</span>
|
||||||
<span class="row-time">{{ row.time }}</span>
|
<span class="row-time">{{ row.time }}</span>
|
||||||
<span class="row-action">{{ row.action }}</span>
|
<span class="row-action" :title="row.action">{{ row.action }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import ChiefTurnCard from '../components/chief/ChiefTurnCard.vue';
|
|||||||
import ChiefCommandEditor from '../components/chief/ChiefCommandEditor.vue';
|
import ChiefCommandEditor from '../components/chief/ChiefCommandEditor.vue';
|
||||||
import { trpc } from '../utils/trpc';
|
import { trpc } from '../utils/trpc';
|
||||||
import { formatOfficerLevelText } from '../utils/nationFormat';
|
import { formatOfficerLevelText } from '../utils/nationFormat';
|
||||||
|
import { formatReservedCommandBrief } from '../components/command/reservedCommandBrief';
|
||||||
import type { CommandMapData, CommandMapLayout, CommandPatternEntry, CommandTable } from '../components/command/types';
|
import type { CommandMapData, CommandMapLayout, CommandPatternEntry, CommandTable } from '../components/command/types';
|
||||||
|
|
||||||
type ChiefTurn = {
|
type ChiefTurn = {
|
||||||
@@ -212,7 +213,10 @@ const buildTurnRows = (chief: ChiefEntry): TurnRow[] => {
|
|||||||
? `${String(turnDate.getUTCHours()).padStart(2, '0')}:${String(turnDate.getUTCMinutes()).padStart(2, '0')}`
|
? `${String(turnDate.getUTCHours()).padStart(2, '0')}:${String(turnDate.getUTCMinutes()).padStart(2, '0')}`
|
||||||
: `${String(turnDate.getUTCMinutes()).padStart(2, '0')}:${String(turnDate.getUTCSeconds()).padStart(2, '0')}`
|
: `${String(turnDate.getUTCMinutes()).padStart(2, '0')}:${String(turnDate.getUTCSeconds()).padStart(2, '0')}`
|
||||||
: '--:--';
|
: '--:--';
|
||||||
const actionLabel = labelMap.get(turn.action) ?? turn.action;
|
const actionLabel =
|
||||||
|
formatReservedCommandBrief('nation', turn.action, turn.args, commandTable.value) ??
|
||||||
|
labelMap.get(turn.action) ??
|
||||||
|
turn.action;
|
||||||
return {
|
return {
|
||||||
index: turn.index,
|
index: turn.index,
|
||||||
time: timeLabel,
|
time: timeLabel,
|
||||||
|
|||||||
Reference in New Issue
Block a user