import { describe, expect, it } from "vitest"; import { ROM_ELITE_ABILITIES } from "./romAbilityCatalog"; import { romEffectsForCast } from "./romCombatMechanics"; const grandDispel = ROM_ELITE_ABILITIES.find((ability) => ability.dbcSpellId === 492928)!; const purify = ROM_ELITE_ABILITIES.find((ability) => ability.dbcSpellId === 491588)!; const grandDispelTag = "rom-priest-mage-grand-dispel"; const mechanics = { sealStacks: 0, bleedCount: 0, charged: false, mainHandDagger: false, casterMaxHealth: 1_000, targetHealthPercent: 1, }; function cleanseCategories(effects: ReturnType): readonly string[] | undefined { const dispel = effects.find((effect) => effect.kind === "dispel"); return dispel?.kind === "dispel" ? dispel.categories : undefined; } describe("RoM Mage/Priest Grand Dispel", () => { it("exposes its source passive marker and keeps Purify curse-only without it", () => { expect(grandDispel.effects).toEqual(expect.arrayContaining([ expect.objectContaining({ kind: "apply-aura", aura: expect.objectContaining({ utilityTags: [grandDispelTag] }), }), ])); expect(purify).toMatchObject({ classId: "rom-mage", secondaryClassId: "rom-priest" }); expect(cleanseCategories(romEffectsForCast(purify, mechanics))).toEqual(["curse"]); }); it("adds only modeled harmful cleanse categories for the matching pair with Grand Dispel", () => { const withPassive = romEffectsForCast(purify, { ...mechanics, passiveTags: [grandDispelTag], }); expect(withPassive).toContainEqual(expect.objectContaining({ kind: "dispel", mode: "cleanse", relationship: "friendly", categories: ["magic", "curse", "poison", "disease"], maxCount: 1, })); const wrongPair = romEffectsForCast({ ...purify, secondaryClassId: "rom-knight" }, { ...mechanics, passiveTags: [grandDispelTag], }); expect(cleanseCategories(wrongPair)).toEqual(["curse"]); }); });