import { describe, expect, it } from "vitest";
import { expectedEpcRating } from "./expectedEpc";

describe("expectedEpcRating", () => {
  it("uses the default plan's post EPC rating when present", () => {
    expect(
      expectedEpcRating({ postEpcRating: "C", postSapPoints: 71.4 }),
    ).toBe("C");
  });

  it("derives the band from post SAP when the plan has no stored rating", () => {
    expect(
      expectedEpcRating({ postEpcRating: null, postSapPoints: 64 }),
    ).toBe("D");
  });

  it("is blank when the property has no default plan", () => {
    expect(expectedEpcRating(null)).toBe("");
  });
});
