Files
tech-log-frontend/tests/e2e/tech-log-responsive.spec.ts
T
DongHyeonka abe4ec97bc fix(studio): 블록 편집기 손잡이 여백이 935px 이하에서 화면 밖으로 나가지 않는다
본문 블록 편집기(d72eae2, 09-16)는 드래그 손잡이와 블록 동작 칸을 읽기
단 바깥에 둔다. 그래서 section.studio-block-editor에 margin 0 -38px를 준다.
그런데 편집 화면의 옆 여백은 936px 이상에서만 38px 이상이다. 그 아래로는
24px(single-surface .studio-main이 100% - 48px), 760px 이하에서는 14px다.
그래서 761~935px에서는 14px, 760px 이하에서는 4px만큼 페이지 전체가
가로로 스크롤된다(760px 이하 규칙의 -18px도 14px 여백보다 넓다).

e2e의 「Studio editor has no overflow」는 이것을 잡지 못했다. 블록
편집기는 폼의 나머지보다 늦게 그려지는데, 시험은 그 전에 폭을 쟀다.
WebKit에서만 가끔 늦게 재서 900·820·768px이 떨어졌다.

손잡이 여백을 그 폭의 옆 여백에 맞춘다. 935px 이하는 24px(손잡이 칸
20px), 760px 이하는 14px(손잡이 칸 14px)이다. 936px 이상은 그대로다.
시험은 블록 편집기가 그려진 뒤에 잰다.

버린 대안: 상위 요소에 overflow-x: clip. 스크롤은 없어지지만 손잡이가
화면 밖에서 잘린 채 남는다.

검증:
- 폭별 측정(chromium): 고치기 전 935px 1, 930px 3, 920px 8, 900~761px 14,
  760px 이하 4px 넘침. 936px 이상은 0.
- 시험만 고친 상태에서 chromium·chromium-compact의 Studio editor 20건 중
  14건(935px 이하 일곱 폭 × 2) 실패. 고친 뒤 tech-log-responsive.spec.ts가
  chromium·firefox·webkit·chromium-compact에서 88건 모두 통과.
2026-11-12 18:38:30 +09:00

46 lines
1.8 KiB
TypeScript

import { expect, test } from "../support/browser/strict-browser-test.ts";
import {
gotoTechLog,
gotoTechLogStudio,
horizontalOverflow,
TECH_LOG_BREAKPOINT_WIDTHS,
} from "../support/browser/tech-log-fixtures.ts";
for (const width of TECH_LOG_BREAKPOINT_WIDTHS) {
test(`Public shell has no overflow and preserves the ${width}px breakpoint contract`, async ({
page,
}) => {
await page.setViewportSize({ width, height: 900 });
await gotoTechLog(page, "/");
const dimensions = await horizontalOverflow(page);
expect(dimensions.scrollWidth).toBeLessThanOrEqual(dimensions.clientWidth);
if (width <= 1050) {
await expect(page.locator("details.mobile-nav > summary")).toBeVisible();
await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeHidden();
} else {
await expect(page.locator("details.mobile-nav > summary")).toBeHidden();
await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeVisible();
}
});
}
for (const width of [1050, 1024, 980, 900, 820, 768, 767, 420, 390, 375] as const) {
test(`Studio editor has no overflow and preserves the ${width}px editor transition`, async ({
page,
}) => {
await page.setViewportSize({ width, height: 1000 });
await gotoTechLogStudio(
page,
"/studio/documents/11111111-1111-4111-8111-111111111111/edit",
);
// The body's block editor draws after the rest of the form. Measured
// before it, the page never overflowed; its gutter is what overflowed.
await page.locator("section.studio-block-editor").waitFor();
const dimensions = await horizontalOverflow(page);
expect(dimensions.scrollWidth).toBeLessThanOrEqual(dimensions.clientWidth);
await expect(page.getByRole("heading", { level: 1 })).toBeVisible();
await expect(page.getByRole("button", { name: "저장" })).toBeVisible();
});
}