Spaces:
Paused
Paused
Download console/src/components/AgentStatusIndicator/AgentStatusIndicator.test.tsx from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 761 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/components/AgentStatusIndicator/AgentStatusIndicator.test.tsx
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/components/AgentStatusIndicator/AgentStatusIndicator.test.tsx
-
curl -L -o AgentStatusIndicator.test.tsx https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/components/AgentStatusIndicator/AgentStatusIndicator.test.tsx
761 Bytes
| 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); | |
| }); | |
| }); | |