35 lines
1.7 KiB
TypeScript
35 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { abilitiesForCharacter, type AbilityDefinition } from "./abilityCatalog";
|
|
|
|
function ability(
|
|
primary: "rom-priest",
|
|
secondary: "rom-scout" | "rom-rogue" | null,
|
|
sourceId: number,
|
|
): AbilityDefinition {
|
|
const match = abilitiesForCharacter(primary, secondary).find((candidate) => candidate.dbcSpellId === sourceId);
|
|
if (!match) throw new Error(`Missing Priest ability ${sourceId}`);
|
|
return match;
|
|
}
|
|
|
|
describe("RoM Priest party buff scopes", () => {
|
|
it.each([
|
|
[null, 490298, "Blessed Spring Water"],
|
|
["rom-scout", 491323, "Embrace of the Water Spirit"],
|
|
["rom-rogue", 492932, "Shadow Fury"],
|
|
] as const)("applies %s to its source-described party", (secondary, sourceId, name) => {
|
|
const buff = ability("rom-priest", secondary, sourceId);
|
|
expect(buff.name).toBe(name);
|
|
|
|
const auras = buff.effects.filter((effect) => effect.kind === "apply-aura");
|
|
const buffs = auras.filter((effect) => effect.kind === "apply-aura" && (effect.aura.modifiers?.length ?? 0) > 0);
|
|
expect(buffs.length).toBeGreaterThan(0);
|
|
expect(buffs.every((effect) => effect.kind === "apply-aura" && effect.scope === "party")).toBe(true);
|
|
expect(buffs.every((effect) => effect.kind === "apply-aura" && effect.recipient === "caster")).toBe(true);
|
|
expect(buffs.every((effect) => effect.kind === "apply-aura" && effect.aura.durationMs === 900_000)).toBe(true);
|
|
// The Scout pairing also has an independent periodic trigger state; it remains caster-only.
|
|
expect(auras.filter((effect) => effect.kind === "apply-aura" && effect.aura.procs?.length).every(
|
|
(effect) => effect.kind === "apply-aura" && effect.scope !== "party",
|
|
)).toBe(true);
|
|
});
|
|
});
|