You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.1 KiB
TypeScript
56 lines
2.1 KiB
TypeScript
// frontend/playwright/shell.spec.ts
|
|
import { test, expect } from "@playwright/test";
|
|
|
|
test("/ → /dashboard 리다이렉트", async ({ page }) => {
|
|
await page.goto("/");
|
|
await expect(page).toHaveURL(/\/dashboard$/);
|
|
});
|
|
|
|
test("13개 내비 항목이 모든 페이지에서 보인다", async ({ page }) => {
|
|
await page.goto("/tasks");
|
|
for (const label of ["대시보드", "인박스", "결재함", "작업", "하루 마감"]) {
|
|
await expect(page.getByRole("link", { name: new RegExp(label) })).toBeVisible();
|
|
}
|
|
});
|
|
|
|
test("placeholder 라우트는 '준비 중'을 보여준다", async ({ page }) => {
|
|
await page.goto("/research");
|
|
await expect(page.getByText("준비 중")).toBeVisible();
|
|
await expect(page.getByRole("heading", { name: "리서치" })).toBeVisible();
|
|
});
|
|
|
|
test("작업 라우트에서 '작업' 내비가 active", async ({ page }) => {
|
|
await page.goto("/tasks");
|
|
await expect(page.getByRole("link", { name: /작업/ })).toHaveClass(/active/);
|
|
});
|
|
|
|
test("테마 토글이 새로고침 후에도 유지된다", async ({ page }) => {
|
|
await page.goto("/dashboard");
|
|
await page.getByLabel("테마 전환").click();
|
|
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
|
|
await page.reload();
|
|
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark"); // localStorage 영속
|
|
});
|
|
|
|
test("모든 10개 placeholder 라우트가 '준비 중' 카드를 렌더한다", async ({ page }) => {
|
|
const routes: [string, string][] = [
|
|
["/approvals", "결재함"],
|
|
["/automation", "자동화"],
|
|
["/journey", "여정"],
|
|
["/calendar", "일정"],
|
|
["/mail", "메일"],
|
|
["/notifications", "알림"],
|
|
["/research", "리서치"],
|
|
["/trip", "여행"],
|
|
["/life", "라이프"],
|
|
["/wrap", "하루 마감"],
|
|
];
|
|
for (const [href, title] of routes) {
|
|
await page.goto(href);
|
|
await expect(page.getByRole("heading", { name: title })).toBeVisible();
|
|
await expect(page.getByText("준비 중")).toBeVisible();
|
|
// 셸(Topbar) 유지 확인
|
|
await expect(page.getByRole("link", { name: "아리 홈" })).toBeVisible();
|
|
}
|
|
});
|