test(visual): 모르는 slug 화면이 SPA 안의 not-found를 찍는다
visual의 「unknown Public …」 20건은 /projects/missing-project 같은 경로가
서버의 평문 「Not Found」를 받는다고 기대하고, 그것을 찍는다. 6784eb1
(08-20)부터 서버는 등록된 Public 경로 패턴이면 SPA를 내고, 게시되지 않은
slug는 화면 안의 not-found(「페이지를 찾을 수 없습니다.」)가 된다. 그래서
글자를 찾지 못해 스크린샷 전에 떨어진다.
화면 안의 not-found h1과 site-frame을 확인하고 찍는다. 경로가 없는
NOT_FOUND의 평문 응답 visual은 그대로다. 기준 이미지는 visual 기준 갱신
커밋에서 새로 만든다.
This commit is contained in:
@@ -60,13 +60,19 @@ for (const [state, path] of TECH_LOG_STUDIO_STATE_PATHS) {
|
||||
});
|
||||
}
|
||||
|
||||
// 6784eb1 (08-20). The server serves every registered Public route pattern,
|
||||
// so a slug nobody published gets the SPA and its in-shell not-found page,
|
||||
// not the edge's plain-text "Not Found" (that stays for paths no route
|
||||
// declares: NOT_FOUND above).
|
||||
for (const [route, path] of TECH_LOG_UNKNOWN_PUBLIC_PATHS) {
|
||||
for (const width of [360, 1440] as const) {
|
||||
test(`unknown Public ${route} matches the source ${width}px response`, async ({ page }) => {
|
||||
test(`unknown Public ${route} shows the in-shell not-found at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 1000 });
|
||||
await gotoTechLog(page, path);
|
||||
await expect(page.getByText("Not Found", { exact: true })).toBeVisible();
|
||||
await expect(page.locator(".site-frame")).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("heading", { level: 1, name: "페이지를 찾을 수 없습니다." }),
|
||||
).toBeVisible();
|
||||
await expect(page.locator(".site-frame")).toHaveCount(1);
|
||||
await expect(page).toHaveScreenshot(`tech-log-unknown-${route}-${width}.png`, {
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user