forked from phenom/healer-man
35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
import { beforeEach, describe, expect, it } from "vitest";
|
|
import { useCombatStore } from "./combatStore";
|
|
|
|
describe("Death Knight Empower Rune Weapon runtime", () => {
|
|
beforeEach(() => {
|
|
useCombatStore.getState().initializeCharacter({ classId: "death-knight", level: 80, xp: 0 });
|
|
});
|
|
|
|
it("restores all six spent runes when cast", () => {
|
|
const ability = useCombatStore.getState().abilities.find((candidate) => candidate.name === "Empower Rune Weapon");
|
|
expect(ability).toBeDefined();
|
|
useCombatStore.setState((state) => ({
|
|
deathKnightRunes: state.deathKnightRunes.map((rune) => ({ ...rune, readyAt: 11_000 })),
|
|
}));
|
|
|
|
const result = useCombatStore.getState().castAbility(ability!.id, { origin: [0, 0, 0], now: 1_000 });
|
|
|
|
expect(result.ok).toBe(true);
|
|
expect(useCombatStore.getState().deathKnightRunes).toHaveLength(6);
|
|
expect(useCombatStore.getState().deathKnightRunes.every((rune) => rune.readyAt === 0)).toBe(true);
|
|
});
|
|
|
|
it("generates the source-listed 25 Runic Power when cast", () => {
|
|
const ability = useCombatStore.getState().abilities.find((candidate) => candidate.name === "Empower Rune Weapon");
|
|
expect(ability).toBeDefined();
|
|
useCombatStore.setState({ resource: 0, resourcePools: { "runic-power": 0 } });
|
|
|
|
const result = useCombatStore.getState().castAbility(ability!.id, { origin: [0, 0, 0], now: 1_000 });
|
|
|
|
expect(result.ok).toBe(true);
|
|
expect(useCombatStore.getState().resource).toBe(25);
|
|
expect(useCombatStore.getState().resourcePools["runic-power"]).toBe(25);
|
|
});
|
|
});
|