forked from phenom/healer-man
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { applyTalentModifierValue, talentModifiersForRanks } from "./talentModifiers";
|
|
|
|
const CONVECTION_SPELLS = [
|
|
"Earth Shock",
|
|
"Flame Shock",
|
|
"Frost Shock",
|
|
"Lightning Bolt",
|
|
"Chain Lightning",
|
|
"Lava Burst",
|
|
"Earthquake",
|
|
"Wind Shear",
|
|
] as const;
|
|
|
|
describe("WoW Shaman Convection source scopes", () => {
|
|
it.each([1, 2, 3, 4, 5])("applies the generated rank %i reduction to every listed ability", (rank) => {
|
|
const modifiers = talentModifiersForRanks({ "talent-564": rank }, "shaman");
|
|
const convection = modifiers.filter((modifier) => modifier.sourceTalentId === "talent-564");
|
|
expect(convection).toHaveLength(CONVECTION_SPELLS.length);
|
|
|
|
for (const abilityName of CONVECTION_SPELLS) {
|
|
const tags = abilityName === "Frost Shock" ? ["frost"] : [];
|
|
expect(applyTalentModifierValue(100, convection, "resource-cost-percent", { abilityName, tags }), abilityName)
|
|
.toBe(100 - rank * 3);
|
|
}
|
|
expect(applyTalentModifierValue(100, convection, "resource-cost-percent", { abilityName: "Healing Wave" }))
|
|
.toBe(100);
|
|
});
|
|
|
|
it("does not create a Convection cost modifier without a trained rank", () => {
|
|
expect(talentModifiersForRanks({ "talent-564": 0 }, "shaman")
|
|
.filter((modifier) => modifier.sourceTalentId === "talent-564")).toEqual([]);
|
|
});
|
|
});
|