import { describe, it, expect } from "vitest";
import { renderToStaticMarkup } from "react-dom/server";
import { RunEtaPill } from "./run-eta-pill";
describe("RunEtaPill", () => {
it("renders nothing for zero targets", () => {
const html = renderToStaticMarkup(
,
);
expect(html).toBe("");
});
it("shows green 'Fits before deadline' when ETA finishes within the window", () => {
const html = renderToStaticMarkup(
,
);
expect(html).toMatch(/Fits before deadline/);
expect(html).toMatch(/min/);
expect(html).not.toMatch(/Likely to pause/);
expect(html).toContain("emerald");
});
it("shows amber 'Likely to pause' when ETA exceeds the window", () => {
const html = renderToStaticMarkup(
,
);
expect(html).toMatch(/Likely to pause/);
expect(html).toMatch(/Push the deadline later/);
expect(html).toContain("amber");
});
});