// @vitest-environment node import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it } from "vitest"; import { StatusIcon } from "./StatusIcon"; describe("StatusIcon", () => { it("renders covered blocked issues with the cyan covered state visual", () => { const html = renderToStaticMarkup( , ); expect(html).toContain('data-blocker-attention-state="covered"'); expect(html).toContain('aria-label="Blocked · waiting on active sub-issue PAP-2"'); expect(html).toContain('title="Blocked · waiting on active sub-issue PAP-2"'); expect(html).toContain("border-cyan-600"); expect(html).not.toContain("border-red-600"); expect(html).not.toContain("border-dashed"); expect(html).toContain("-bottom-0.5"); }); it("uses covered blocked copy for the active dependency count matrix", () => { const html = renderToStaticMarkup( , ); expect(html).toContain('aria-label="Blocked · covered by 2 active dependencies"'); expect(html).toContain("border-cyan-600"); expect(html).not.toContain("border-dashed"); }); it("keeps normal blocked issues on the attention-required visual", () => { const html = renderToStaticMarkup( , ); expect(html).not.toContain('data-blocker-attention-state="covered"'); expect(html).toContain('data-blocker-attention-state="needs_attention"'); expect(html).toContain('aria-label="Blocked · 1 blocker needs attention"'); expect(html).toContain("border-red-600"); expect(html).not.toContain("border-dashed"); }); it("shows active covered work on mixed attention-required blockers", () => { const html = renderToStaticMarkup( , ); expect(html).toContain('data-blocker-attention-state="needs_attention"'); expect(html).toContain('aria-label="Blocked · 3 blockers need attention; 2 covered by active work"'); expect(html).toContain("border-red-600"); expect(html).not.toContain("border-cyan-600"); expect(html).toContain("bg-cyan-600"); }); it("renders stalled review chains with amber visual and stalled-leaf copy", () => { const html = renderToStaticMarkup( , ); expect(html).toContain('data-blocker-attention-state="stalled"'); expect(html).toContain('aria-label="Blocked · review stalled on PAP-2279"'); expect(html).toContain("border-amber-600"); expect(html).not.toContain("border-cyan-600"); expect(html).not.toContain("border-red-600"); }); });