42 lines
1.7 KiB
TypeScript
42 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { wow335MageFlameThrowingProfile } from "./wow335MageFlameThrowingRuntime";
|
|
|
|
describe("WoW Mage Flame Throwing generated profile", () => {
|
|
it("parses the generated +2/+4/+6 yard damaging-spell range ranks", () => {
|
|
expect([1, 2, 3].map((rank) => wow335MageFlameThrowingProfile(rank).damagingSpellRangeBonusYards))
|
|
.toEqual([2, 4, 6]);
|
|
});
|
|
|
|
it("exposes the 20% Fireball cast-time rider and 12-second lockout only where the generated capstone link exists", () => {
|
|
expect([1, 2].map(wow335MageFlameThrowingProfile)).toEqual([
|
|
expect.objectContaining({
|
|
capstoneAvailable: false,
|
|
fireballCastTimeReductionPercent: 0,
|
|
fireballCastTimeLockoutMs: 0,
|
|
fireballLockoutStart: null,
|
|
}),
|
|
expect.objectContaining({
|
|
capstoneAvailable: false,
|
|
fireballCastTimeReductionPercent: 0,
|
|
fireballCastTimeLockoutMs: 0,
|
|
fireballLockoutStart: null,
|
|
}),
|
|
]);
|
|
expect(wow335MageFlameThrowingProfile(3)).toMatchObject({
|
|
rank: 3,
|
|
damagingSpellRangeBonusYards: 6,
|
|
capstoneAvailable: true,
|
|
fireballCastTimeReductionPercent: 20,
|
|
fireballCastTimeLockoutMs: 12_000,
|
|
fireballLockoutStart: "unspecified",
|
|
});
|
|
});
|
|
|
|
it("normalizes absent and out-of-range talent ranks", () => {
|
|
expect(wow335MageFlameThrowingProfile(0)).toMatchObject({ rank: 0, damagingSpellRangeBonusYards: 0 });
|
|
expect(wow335MageFlameThrowingProfile(-2)).toMatchObject({ rank: 0, damagingSpellRangeBonusYards: 0 });
|
|
expect(wow335MageFlameThrowingProfile(4)).toMatchObject({ rank: 3, capstoneAvailable: true });
|
|
expect(wow335MageFlameThrowingProfile(Number.NaN)).toMatchObject({ rank: 0, capstoneAvailable: false });
|
|
});
|
|
});
|