import { describe, expect, it } from "vitest"; import { ROM_ALL_ABILITIES, ROM_ELITE_ABILITIES } from "./romAbilityCatalog"; import { romEffectsForCast } from "./romCombatMechanics"; import { romPriestKnightCastEffects } from "./romPriestKnightOverrides"; const lightningRodPassive = ROM_ELITE_ABILITIES.find((ability) => ability.dbcSpellId === 492638)!; const lightning = ROM_ALL_ABILITIES.find((ability) => ability.dbcSpellId === 490212)!; const boneChill = ROM_ALL_ABILITIES.find((ability) => ability.dbcSpellId === 491165)!; const lightningRodTag = "rom-priest-mage-lightning-rod"; const boneChillTag = "rom-491165-501548-0"; describe("RoM Priest/Mage Lightning Rod", () => { it("exposes the passive and Bone Chill child tags used by the cast hook", () => { expect(lightningRodPassive.effects).toEqual(expect.arrayContaining([ expect.objectContaining({ kind: "apply-aura", aura: expect.objectContaining({ utilityTags: [lightningRodTag] }), }), ])); expect(boneChill.effects.some((effect) => effect.kind === "dot" && effect.tag === boneChillTag)).toBe(true); }); it("applies the 20-second Water/Wind resistance shock only with the passive and Bone Chill", () => { const withoutPassive = romPriestKnightCastEffects( lightning, lightning.effects, [], 1_000, [boneChillTag], ); const withoutBoneChill = romPriestKnightCastEffects( lightning, lightning.effects, [lightningRodTag], 1_000, [], ); expect(withoutPassive).toEqual(lightning.effects); expect(withoutBoneChill).toEqual(lightning.effects); const withBothConditions = romPriestKnightCastEffects( lightning, lightning.effects, [lightningRodTag], 1_000, [boneChillTag], ); expect(withBothConditions).toContainEqual(expect.objectContaining({ kind: "apply-aura", recipient: "ability-target", triggerSpellId: 502907, aura: expect.objectContaining({ id: "rom-priest-mage-lightning-rod-shock", name: "Electric Shock", disposition: "debuff", durationMs: 20_000, modifiers: [ { kind: "stat", stat: "resistance:frost", operation: "flat", value: -50 }, { kind: "stat", stat: "resistance:nature", operation: "flat", value: -50 }, ], }), })); }); it("keeps the proc on the shared RoM cast-effects path", () => { const mechanics = { sealStacks: 0, bleedCount: 0, charged: false, mainHandDagger: false, casterMaxHealth: 1_000, targetHealthPercent: 1, }; const withoutBoneChill = romEffectsForCast(lightning, { ...mechanics, passiveTags: [lightningRodTag], }); const withBoneChill = romEffectsForCast(lightning, { ...mechanics, passiveTags: [lightningRodTag], targetTags: [boneChillTag], }); expect(withoutBoneChill.some((effect) => effect.kind === "apply-aura" && effect.aura.id === "rom-priest-mage-lightning-rod-shock")).toBe(false); expect(withBoneChill.some((effect) => effect.kind === "apply-aura" && effect.aura.id === "rom-priest-mage-lightning-rod-shock")).toBe(true); }); });