48 lines
2.3 KiB
TypeScript
48 lines
2.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { loadCanonicalBenchmarkBuilds } from "./benchmark/benchmarkBuilds";
|
|
import { rotationProfileFor } from "./combatRotation";
|
|
import { READY_COMPANION_SPECIALIZATION_IDS } from "./companionSpecReadiness";
|
|
import { createDungeonParty } from "./partyStore";
|
|
import { runtimeNormalizeTalentRanks } from "./talentRuntimeCatalog";
|
|
import { runtimePartyTalentRanksForLevel } from "./partyTalentRuntime";
|
|
import { specializationById } from "./specializationCatalog";
|
|
|
|
const READY_CASES = [
|
|
["warrior:protection", "warrior", "Protection"],
|
|
["priest:discipline", "priest", "Discipline"],
|
|
["hunter:marksmanship", "hunter", "Marksmanship"],
|
|
["mage:fire", "mage", "Fire"],
|
|
["rogue:assassination", "rogue", "Assassination"],
|
|
] as const;
|
|
|
|
describe("Ready-five certification scope", () => {
|
|
it("keeps the canonical benchmark default limited to the five Ready specs", async () => {
|
|
const builds = await loadCanonicalBenchmarkBuilds();
|
|
expect(builds.map((build) => `${build.classId}:${build.orientation.toLowerCase()}`))
|
|
.toEqual(expect.arrayContaining([...READY_COMPANION_SPECIALIZATION_IDS]));
|
|
expect(builds).toHaveLength(READY_COMPANION_SPECIALIZATION_IDS.length);
|
|
});
|
|
|
|
it("has legal level-bracket talents and an executable rotation for every Ready spec", () => {
|
|
for (const [specializationId, classId, specialization] of READY_CASES) {
|
|
expect(specializationById(specializationId)).not.toBeNull();
|
|
expect(rotationProfileFor(classId, specializationId, specialization)?.abilityPriority.length ?? 0)
|
|
.toBeGreaterThan(0);
|
|
for (const level of [1, 10, 20, 30, 40, 50, 60, 70, 80]) {
|
|
const ranks = runtimePartyTalentRanksForLevel(classId, specialization, level);
|
|
expect(runtimeNormalizeTalentRanks(classId, level, ranks)).toEqual(ranks);
|
|
}
|
|
}
|
|
});
|
|
|
|
it("draws random dungeon companions only from the Ready set", () => {
|
|
const ready = new Set<string>(READY_COMPANION_SPECIALIZATION_IDS);
|
|
for (const playerRole of ["tank", "healer", "damage"] as const) {
|
|
for (let seed = 0; seed < 12; seed += 1) {
|
|
const party = createDungeonParty(`ready-five-${playerRole}-${seed}`, 80, playerRole);
|
|
expect(party.every((member) => ready.has(member.specializationId ?? ""))).toBe(true);
|
|
}
|
|
}
|
|
});
|
|
});
|