import { describe, expect, it } from "vitest"; import { CLASSES } from "../../app/characterCatalog"; import { partyRolesForClass } from "../partyRoles"; import { runtimeNormalizeTalentRanks } from "../talentRuntimeCatalog"; import { loadCanonicalBenchmarkBuilds } from "./benchmarkBuilds"; describe("canonical benchmark builds", () => { it("covers every declared class-role pair exactly once with legal ranks", async () => { const builds = await loadCanonicalBenchmarkBuilds(); const expectedPairs = CLASSES.flatMap((definition) => ( partyRolesForClass(definition.id).map((role) => `${definition.id}:${role}`) )); const actualPairs = builds.map((build) => `${build.classId}:${build.role}`); expect(builds).toHaveLength(77); expect(new Set(actualPairs).size).toBe(builds.length); expect(new Set(actualPairs)).toEqual(new Set(expectedPairs)); for (const build of builds) { expect(build.level).toBe(60); expect(build.gearPresetId).toBe("coefficient-empty"); expect(build.inventory).toEqual([]); expect(build.equipment).toEqual({}); expect(runtimeNormalizeTalentRanks(build.classId, build.level, build.talentRanks)).toEqual(build.talentRanks); } }, 60_000); it("filters classes without changing their canonical definitions", async () => { const builds = await loadCanonicalBenchmarkBuilds(60, ["mage", "rom-priest"]); expect(builds.map((build) => `${build.classId}:${build.role}`)).toEqual([ "mage:damage", "rom-priest:healer", "rom-priest:damage", ]); }); });