import { describe, expect, it } from "vitest"; import { ROM_ALL_ABILITIES } from "./romAbilityCatalog"; import { ROM_COA_WARLOCK_WARRIOR_ENRAGED, ROM_COA_WARLOCK_WARRIOR_ENRAGED_DESCRIPTION, ROM_COA_WARLOCK_WARRIOR_ENRAGED_EFFECTS, romWarlockWarriorEnragedCoaAdditionalAbilities, } from "./romWarlockWarriorEnragedCoaMechanics"; describe("current CoA Warlock/Warrior Enraged identity and payload", () => { it("adds the current 499871 pair skill with its sourced resource values and cooldown", () => { const ability = ROM_ALL_ABILITIES.find((entry) => entry.dbcSpellId === 499_871); expect(ability).toMatchObject({ id: "rom-warlock-rom-warrior-general-coa-499871", classId: "rom-warlock", secondaryClassId: "rom-warrior", name: "Enraged", unlockLevel: 60, sourceUnlockLevel: 60, romSkillGroup: "general", target: "self", range: { min: 0, max: 1 }, castMode: "instant", castTimeMs: 0, cooldownMs: 40_000, cost: { resource: "mana", amount: 0 }, costs: [], effects: [ { kind: "resource", resource: "rage", amount: 100 }, { kind: "resource", resource: "focus", amount: 35 }, { kind: "resource", resource: "psi", amount: 1 }, ], passive: false, }); expect(ability?.description).toBe(ROM_COA_WARLOCK_WARRIOR_ENRAGED_DESCRIPTION); expect(ROM_COA_WARLOCK_WARRIOR_ENRAGED).toMatchObject({ spellId: 499_871, localWarriorGeneralSpellId: 490_492, unresolvedLocalChildSpellId: 499_869, unlockLevel: 60, cooldownMs: 40_000, rage: 100, focus: 35, psi: 1, }); }); it("keeps RuneWaker's Warrior General spell and the unresolved hidden child separate", () => { const localEnraged = ROM_ALL_ABILITIES.find((entry) => entry.dbcSpellId === 490_492); expect(localEnraged?.classId).toBe("rom-warrior"); expect(localEnraged?.secondaryClassId).toBeUndefined(); expect(localEnraged?.effects).not.toEqual(ROM_COA_WARLOCK_WARRIOR_ENRAGED_EFFECTS); expect(ROM_ALL_ABILITIES.some((entry) => entry.dbcSpellId === 499_869)).toBe(false); expect(ROM_ALL_ABILITIES.filter((entry) => entry.dbcSpellId === 499_871)).toHaveLength(1); }); it("gates the addition to the sourced Warlock/Warrior pair and is idempotent", () => { const current = ROM_ALL_ABILITIES.find((entry) => entry.dbcSpellId === 499_871)!; expect(romWarlockWarriorEnragedCoaAdditionalAbilities([current])).toEqual([]); const noLocalSource = ROM_ALL_ABILITIES.filter((entry) => ![490_492, 499_871].includes(entry.dbcSpellId)); expect(() => romWarlockWarriorEnragedCoaAdditionalAbilities(noLocalSource)).toThrow(/without the separate RuneWaker Warrior General row/); }); });