test: prove TechLog UI migration parity

This commit is contained in:
DongHyeonka
2026-08-16 02:48:26 +09:00
parent c5c8b9423c
commit 6c2780b7a7
176 changed files with 2393 additions and 616 deletions
+14 -17
View File
@@ -1,7 +1,8 @@
import { expect, test } from "../support/browser/strict-browser-test.ts";
import { gotoTechLog } from "../support/browser/tech-log-fixtures.ts";
test("boots the public app shell", async ({ page }) => {
await page.goto("/");
await gotoTechLog(page, "/");
await expect(page.getByRole("heading", { level: 1 })).toHaveText(
"Tech Log",
);
@@ -9,36 +10,32 @@ test("boots the public app shell", async ({ page }) => {
await expect(page.getByRole("main")).toBeVisible();
});
test("navigates to a registry-backed example without a page reload", async ({
test("navigates to a registry-backed Public route without a page reload", async ({
page,
}) => {
await page.goto("/");
await gotoTechLog(page, "/");
await page
.getByRole("navigation", { name: "주요 탐색" })
.getByRole("link", { name: "화면 상태" })
.getByRole("link", { name: "프로젝트" })
.click();
await expect(page).toHaveURL(/\/examples\/states$/);
await expect(page).toHaveURL(/\/projects$/);
await expect(
page.getByRole("heading", { level: 1, name: "화면 상태" }),
).toBeFocused();
page.getByRole("heading", { level: 1, name: "프로젝트" }),
).toBeVisible();
});
test("provides an escape-dismissible mobile navigation", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto("/");
const menu = page.getByRole("button", { name: "메뉴", exact: true });
await gotoTechLog(page, "/");
const menu = page.locator("details.mobile-nav > summary");
await menu.click();
await expect(menu).toHaveAttribute("aria-expanded", "true");
await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeVisible();
await expect(page.locator(".ui-drawer")).toHaveJSProperty("open", true);
expect(
await page.locator(".ui-drawer").evaluate((drawer) => drawer.matches(":modal")),
).toBe(true);
await expect(page.locator("details.mobile-nav")).toHaveAttribute("open", "");
await expect(page.getByRole("navigation", { name: "모바일 주요 탐색" })).toBeVisible();
await page.keyboard.press("Escape");
await expect(menu).toHaveAttribute("aria-expanded", "false");
await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeHidden();
await expect(page.locator("details.mobile-nav")).not.toHaveAttribute("open", "");
await expect(page.getByRole("navigation", { name: "모바일 주요 탐색" })).toBeHidden();
await expect(menu).toBeFocused();
});