Files
buzz-sheet/lib/guides/talents.test.ts
T
gunshiz 8177c91434
CI / Verify (push) Successful in 50s
CI / Build immutable images and deploy (push) Successful in 4m15s
feat : update
2026-08-30 11:17:58 +00:00

36 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { normalizeTalentPriorities, reorderTalentPriorities, talentRelationSymbol } 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 strict and greater-than-or-equal relations", () => {
expect(talentRelationSymbol("gt")).toBe(">");
expect(talentRelationSymbol("gte")).toBe("≥");
expect(talentRelationSymbol()).toBe(">");
});
});