import { describe, expect, it } from "vitest"; import { runtimeNormalizeTalentRanks } from "../talentRuntimeCatalog"; import { loadCanonicalBenchmarkBuilds, loadSelectableBenchmarkBuilds, selectableBenchmarkBuildCatalog, } from "./benchmarkBuilds"; describe("canonical benchmark builds", () => { it("defaults to the five Ready class/spec builds with legal ranks", async () => { const builds = await loadCanonicalBenchmarkBuilds(); expect(builds.map((build) => `${build.classId}:${build.orientation}:${build.role}`)).toEqual([ "warrior:Protection:tank", "hunter:Marksmanship:damage", "rogue:Assassination:damage", "priest:Discipline:healer", "mage:Fire:damage", ]); for (const build of builds) { expect(build.level).toBe(60); expect(build.gearPresetId).toBe("virtual-heirloom"); 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", ]); }); it("keeps both named classic talent builds and marks Playerbots as the default", async () => { const catalog = selectableBenchmarkBuildCatalog(60, ["mage"]); const builds = await loadSelectableBenchmarkBuilds(60, ["mage"]); expect(catalog).toHaveLength(6); expect(builds).toHaveLength(6); expect(new Set(builds.map((build) => build.characterName)).size).toBe(6); for (const specialization of ["Arcane", "Fire", "Frost"]) { const variants = builds.filter((build) => build.orientation === specialization); expect(variants).toHaveLength(2); expect(variants.filter((build) => build.defaultTalentBuild)).toHaveLength(1); expect(variants.find((build) => build.defaultTalentBuild)?.talentBuildSource) .toBe("azerothcore-playerbots@531282e"); } }, 30_000); });