18 lines
633 B
TypeScript
18 lines
633 B
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import "@testing-library/jest-dom/vitest";
|
|
import { describe, expect, it } from "vitest";
|
|
import { StateView } from "../src/components/common/StateView.js";
|
|
|
|
describe("StateView", () => {
|
|
it.each([
|
|
["loading", "正在建立训练会话"],
|
|
["reconnecting", "事件流正在重连"],
|
|
["busy", "Agent 正在运行"],
|
|
["approval", "等待工具审批"],
|
|
["error", "会话启动失败"],
|
|
] as const)("renders the %s state", (kind, label) => {
|
|
render(<StateView kind={kind} title={label} />);
|
|
expect(screen.getByText(label)).toBeVisible();
|
|
});
|
|
});
|