// @vitest-environment happy-dom
import { afterEach, describe, expect, it } from "vitest";
import { cleanup, render } from "@testing-library/react";
import { CandidateBreakdown } from "./CandidateBreakdown";

afterEach(() => cleanup());

describe("CandidateBreakdown", () => {
  it("renders per-field scores", () => {
    const { container } = render(
      <CandidateBreakdown
        score={92}
        breakdown={{ patient: 1, date: 1, amount: 1, provider: 1 }}
        tier="strong"
      />,
    );
    expect(container.textContent).toMatch(/patient/i);
    expect(container.textContent).toMatch(/date/i);
    expect(container.textContent).toMatch(/amount/i);
    expect(container.textContent).toMatch(/provider/i);
    expect(container.textContent).toContain("92");
  });
});
