import { describe, expect, it } from "vitest";
import { getApplicationMeritCategoryHint } from "@/components/admin/review/applicationMeritCategoryHint";

describe("getApplicationMeritCategoryHint", () => {
  it("returns trung bình for research + poster-without-review (2.1.4)", () => {
    const hint = getApplicationMeritCategoryHint({
      initiativeClassification: "research",
      researchEvidenceKind: "poster-without-review",
      textbookEvidenceKind: "",
    });
    expect(hint.subgroupCode).toBe("2.1.4");
    expect(hint.meritLevel).toBe("trung bình");
    expect(hint.detail).toContain("không phản biện");
  });

  it("returns khá for research + poster (2.1.3)", () => {
    const hint = getApplicationMeritCategoryHint({
      initiativeClassification: "research",
      researchEvidenceKind: "poster",
      textbookEvidenceKind: "",
    });
    expect(hint.subgroupCode).toBe("2.1.3");
    expect(hint.meritLevel).toBe("khá");
  });

  it("returns xuất sắc for textbook + book (sách giáo trình)", () => {
    const hint = getApplicationMeritCategoryHint({
      initiativeClassification: "textbook",
      researchEvidenceKind: "",
      textbookEvidenceKind: "book",
    });
    expect(hint.subgroupCode).toBe("2.2.1");
    expect(hint.meritLevel).toBe("xuất sắc");
  });
});
