교수자 요약 카드 간격을 분리

This commit is contained in:
Yun Chan 2026-08-29 16:37:10 +09:00
parent ffadc8bd49
commit 5bf89ff4ee
4 changed files with 35 additions and 1 deletions

View file

@ -313,6 +313,30 @@ async function gateScreen(
}
}
async function expectProfessorSummaryGap(page: Page) {
const metrics = await page.locator(".pf-signal-strip").evaluate((strip) => {
const triage = strip.querySelector<HTMLElement>(".pf-triage");
const summary = strip.querySelector<HTMLElement>(".pf-kpis");
if (!triage || !summary) return null;
const triageRect = triage.getBoundingClientRect();
const summaryRect = summary.getBoundingClientRect();
return {
actualGap: summaryRect.top - triageRect.bottom,
rowGap: Number.parseFloat(getComputedStyle(strip).rowGap),
};
});
const width = page.viewportSize()?.width ?? "unknown";
expect(metrics, `[professor @ ${width}px] signal cards must be measurable`).not.toBeNull();
expect(
Math.abs(metrics!.actualGap - 12),
`[professor @ ${width}px] rendered signal-card gap`,
).toBeLessThanOrEqual(1);
expect(
Math.abs(metrics!.rowGap - 12),
`[professor @ ${width}px] computed signal-card row-gap`,
).toBeLessThanOrEqual(0.1);
}
/** 리뷰는 모든 폭에서 가로 탭으로 영역을 전환한다. */
async function openReviewTabIfPresent(page: Page, label: string) {
const tab = page.locator(".sr-tabs button", { hasText: label });
@ -684,6 +708,7 @@ test.describe("layout visual gate @single-run", () => {
await expect(page.locator(".pf-panel, .pf-shell, main").first()).toBeVisible({
timeout: 15_000,
});
await expectProfessorSummaryGap(page);
});
});