- fix(FN-2729): silence ansi strip lint warning - test(FN-2729): complete Step 10 — cover node health indicators - feat(FN-2729): complete Step 9 — colorize CLI node status output - feat(FN-2729): complete Step 8 — use NodeHealthDot in settings routing status - test(FN-2729): align ListView node override option expectations - feat(FN-2729): complete Step 7 — add bulk node status indicators - fix(engine): prevent auto-merge cooldown loop on unresolvable conflicts - feat(FN-2911): improve chat attachment compose and preview UX - feat(FN-2921): merge fusion/fn-2921 - feat(FN-2909): merge fusion/fn-2909 - feat(FN-2914): merge fusion/fn-2914 - feat(FN-2902): merge fusion/fn-2902 - chore(release): v0.8.3 - Update changeset - fix(tui): swap 3/4 panel hotkeys so they match the help text - fix(tui): always show auth token and report accurate macOS memory usage Fusion-Task-Id: FN-2729
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { render, screen } from "@testing-library/react";
|
|
import { NodeHealthDot } from "../NodeHealthDot";
|
|
|
|
describe("NodeHealthDot", () => {
|
|
it.each(["online", "offline", "error", "connecting"] as const)("renders status dot for %s", (status) => {
|
|
render(<NodeHealthDot status={status} />);
|
|
expect(document.querySelector(`.status-dot--${status}`)).toBeInTheDocument();
|
|
});
|
|
|
|
it("shows label when requested", () => {
|
|
render(<NodeHealthDot status="online" showLabel />);
|
|
expect(screen.getByText("Online")).toBeInTheDocument();
|
|
});
|
|
|
|
it("hides label by default", () => {
|
|
render(<NodeHealthDot status="online" />);
|
|
expect(document.querySelector(".node-health-dot__label")).toBeNull();
|
|
});
|
|
|
|
it("applies compact class", () => {
|
|
render(<NodeHealthDot status="online" compact />);
|
|
expect(document.querySelector(".node-health-dot--compact")).toBeInTheDocument();
|
|
});
|
|
|
|
it("sets accessible label and title", () => {
|
|
render(<NodeHealthDot status="online" />);
|
|
const wrapper = screen.getByLabelText("Node status: Online");
|
|
expect(wrapper).toHaveAttribute("title", "Online");
|
|
});
|
|
});
|