import { describe, expect, it } from "vitest"; import { TALENT_NODES, TALENT_TREES } from "./talentCatalog"; import { loadTalentUiCatalog, talentUiNodesForTree } from "./talentUiCatalog"; describe("talent UI catalog shards", () => { it.each(["warrior", "barbarian"] as const)("loads only the %s class projection", async (classId) => { const catalog = await loadTalentUiCatalog(classId); const sourceTrees = TALENT_TREES.filter((tree) => tree.classId === classId); const sourceTreeIds = new Set(sourceTrees.map((tree) => tree.id)); const sourceNodes = TALENT_NODES.filter((node) => sourceTreeIds.has(node.treeId)); expect(catalog.classId).toBe(classId); expect(catalog.trees.map((tree) => tree.id)).toEqual(sourceTrees.map((tree) => tree.id)); expect(catalog.nodes.map((node) => node.id)).toEqual(sourceNodes.map((node) => node.id)); expect(catalog.nodes.every((node) => !("rankEffects" in node))).toBe(true); for (const tree of catalog.trees) { expect(talentUiNodesForTree(catalog, tree.id).every((node) => node.treeId === tree.id)).toBe(true); } }); });