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.

38 lines
1.4 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/tests/journey/JourneyClient.test.tsx — JF-1: 4단계 라벨 + 패널 라벨
import { render } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { journey } from "./fixtures";
vi.mock("@/lib/hooks/useJourney", () => ({
useJourney: () => ({ data: journey, error: null, isLoading: false, retry: vi.fn() }),
}));
// next/navigation 의존 없음 (JourneyClient 는 셸 밖 본문만 렌더)
import { JourneyClient } from "@/components/journey/JourneyClient";
describe("JourneyClient (JF-1)", () => {
it("4단계 라벨 + 단계 시간을 렌더한다", () => {
const { container } = render(<JourneyClient />);
const text = container.textContent ?? "";
["아침 준비", "오전 집중", "오후 협업", "마무리 & 내일"].forEach((t) =>
expect(text).toContain(t),
);
// 단계 시간(라벨 영역)
expect(text).toContain("06:40 09:00");
expect(text).toContain("17:00 23:00");
// 헤더 제목
expect(text).toContain("오늘의 여정");
});
it("패널 라벨 '4단계 · 12개 항목 · 5명 협업'", () => {
const { container } = render(<JourneyClient />);
const label = container.querySelector(".jx-label");
expect(label).toBeTruthy();
const t = label!.textContent ?? "";
expect(t).toContain("오늘의 흐름");
expect(t).toContain("4단계");
expect(t).toContain("12개 항목");
expect(t).toContain("5명 협업");
});
});