import { describe, it, expect } from "vitest"; import { renderSVGDonut } from "./donut"; describe("donut", () => { describe("renderSVGDonut", () => { it("renders SVG with zero rate", () => { const svg = renderSVGDonut(0); expect(svg).toContain(' { const svg = renderSVGDonut(50); expect(svg).toContain(' { const svg = renderSVGDonut(100); expect(svg).toContain(' { const svg = renderSVGDonut(75); expect(svg).toContain(""); expect(svg).toContain("linearGradient"); expect(svg).toContain("donut-grad"); expect(svg).toContain(" { const svg = renderSVGDonut(-10); expect(svg).toContain("0.0%"); }); it("clamps rate above 100 to 100", () => { const svg = renderSVGDonut(150); expect(svg).toContain("100.0%"); }); it("renders label with percentage", () => { const svg = renderSVGDonut(33.5); expect(svg).toContain("33.5%"); }); it("has fixed size 120x120", () => { const svg = renderSVGDonut(25); expect(svg).toContain('width="120"'); expect(svg).toContain('height="120"'); }); it("uses background circle and gradient stroke circle", () => { const svg = renderSVGDonut(50); const circleCount = (svg.match(/