File size: 761 Bytes
4e7644b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { AgentStatusIndicator } from "./index";

vi.mock("react-i18next", () => ({
  useTranslation: () => ({ t: (key: string) => key }),
}));

describe("AgentStatusIndicator", () => {
  it.each([
    ["disabled", "agent.status.disabled"],
    ["pending", "agent.status.pending"],
    ["starting", "agent.status.starting"],
    ["running", "agent.status.running"],
    ["failed", "agent.status.failed"],
  ] as const)("renders %s status", (status, label) => {
    render(<AgentStatusIndicator status={status} />);
    const indicator = screen.getByRole("status", { name: label });
    expect(indicator).toHaveAttribute("data-status", status);
  });
});