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.

64 lines
3.0 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// frontend/playwright/calendar.spec.ts — 일정/회의 E2E (액션→작업 왕복 + a11y)
// 백엔드는 ARI_ALLOW_TEST_RESET=1 LLM_PROVIDER=heuristic 로 기동 가정.
import AxeBuilder from "@axe-core/playwright";
import { expect, test } from "@playwright/test";
import { resetSeed } from "./fixtures/seed-reset";
test.describe.configure({ mode: "serial" });
test.beforeEach(async () => {
await resetSeed();
});
test("주 뷰 기본 + 일 뷰 전환 + 회의 진입 버튼", async ({ page }) => {
await page.goto("/calendar");
await expect(page.getByRole("heading", { name: "6월 7일 13일" })).toBeVisible();
await page.getByRole("tab", { name: "일" }).click();
await expect(page.getByRole("button", { name: /회의 노트 · 액션 보기/ }).first()).toBeVisible();
});
test("회의 액션 → 작업 페이지 등장 (federation)", async ({ page }) => {
await page.goto("/calendar");
await page.getByRole("tab", { name: "일" }).click();
await page.getByRole("button", { name: /회의 노트 · 액션 보기/ }).first().click();
await expect(page.getByRole("dialog", { name: "회의 도우미" })).toBeVisible();
await expect(page.getByText("매출 데이터 전달")).toBeVisible();
// e3 는 미처리 액션이 '매출 데이터 전달' 1건 → 클릭 후 '작업으로' 버튼이 사라짐
await page.getByRole("button", { name: "작업으로", exact: true }).click();
await expect(page.getByRole("button", { name: "작업으로", exact: true })).toHaveCount(0);
await expect(page.getByText("작업에 있음").first()).toBeVisible();
// 작업 페이지에서 확인
await page.goto("/tasks");
await expect(page.getByText("매출 데이터 전달").first()).toBeVisible();
});
test("사전 브리핑 드로어 a11y (axe)", async ({ page }) => {
await page.goto("/calendar");
await page.getByRole("tab", { name: "일" }).click();
await page.getByRole("button", { name: /사전 브리핑 보기/ }).first().click();
await expect(page.getByRole("dialog")).toBeVisible();
const results = await new AxeBuilder({ page })
.withTags(["wcag2a", "wcag2aa", "wcag21aa"])
.disableRules(["color-contrast"])
.include('[role="dialog"]')
.analyze();
expect(results.violations, JSON.stringify(results.violations, null, 2)).toEqual([]);
});
test("Escape 로 드로어 닫힘", async ({ page }) => {
await page.goto("/calendar");
await page.getByRole("tab", { name: "일" }).click();
await page.getByRole("button", { name: /1:1 어시스턴트 브리핑/ }).first().click();
await expect(page.getByRole("dialog")).toBeVisible();
await page.keyboard.press("Escape");
await expect(page.getByRole("dialog")).toBeHidden();
});
test("카테고리 토글 off → 해당 이벤트 숨김", async ({ page }) => {
await page.goto("/calendar");
await page.getByRole("tab", { name: "일" }).click();
// 건강 카테고리 off (e8 스트레칭 & 명상이 8일에 있음)
await page.getByRole("button", { name: /건강/ }).first().click();
await expect(page.getByText("스트레칭 & 명상")).toHaveCount(0);
});