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.
20 lines
802 B
TypeScript
20 lines
802 B
TypeScript
// frontend/tests/approvals/AutonomyCard.test.tsx
|
|
import { fireEvent, render, screen } from "@testing-library/react";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { AutonomyCard } from "@/components/approvals/AutonomyCard";
|
|
|
|
describe("AutonomyCard", () => {
|
|
it("선택 모드에 on 클래스, 클릭 시 콜백", () => {
|
|
const onPick = vi.fn();
|
|
render(<AutonomyCard autonomy="mixed" onPick={onPick} />);
|
|
expect(screen.getByText("혼합").closest(".au-opt")).toHaveClass("on");
|
|
fireEvent.click(screen.getByText("완전 자율"));
|
|
expect(onPick).toHaveBeenCalledWith("full_auto");
|
|
});
|
|
|
|
it("추천 배지는 혼합에만", () => {
|
|
render(<AutonomyCard autonomy="mixed" onPick={() => {}} />);
|
|
expect(screen.getByText("추천")).toBeInTheDocument();
|
|
});
|
|
});
|