import { describe, expect, it } from "vitest"; import { normalizeTalentPriorities, reorderTalentPriorities, talentRelationSymbol, talentTypeLabel } from "@/lib/guides/talents"; describe("talent priorities", () => { it("normalizes legacy talents to strict comparisons", () => { expect(normalizeTalentPriorities([ { type: "Q", priority: 2 }, { type: "E", priority: 1 }, { type: "NA", priority: 3 }, ])).toEqual([ { type: "E", priority: 1, relationToNext: "gt" }, { type: "Q", priority: 2, relationToNext: "gt" }, { type: "NA", priority: 3, relationToNext: undefined }, ]); }); it("reorders talents while preserving relations between positions", () => { expect(reorderTalentPriorities([ { type: "E", priority: 1, relationToNext: "gte" }, { type: "Q", priority: 2, relationToNext: "gt" }, { type: "NA", priority: 3 }, ], "NA", "E")).toEqual([ { type: "NA", priority: 1, relationToNext: "gte" }, { type: "E", priority: 2, relationToNext: "gt" }, { type: "Q", priority: 3, relationToNext: undefined }, ]); }); it("formats every supported talent relation", () => { expect(talentRelationSymbol("gt")).toBe(">"); expect(talentRelationSymbol("gte")).toBe("≥"); expect(talentRelationSymbol("eq")).toBe("="); expect(talentRelationSymbol()).toBe(">"); }); it("labels each talent type in Thai", () => { expect(talentTypeLabel("NA")).toBe("ตีปกติ"); expect(talentTypeLabel("E")).toBe("สกิลธาตุ"); expect(talentTypeLabel("Q")).toBe("ท่าไม้ตาย"); }); });