forked from phenom/healer-man
Release Healer Man 0.1.9
This commit is contained in:
1 parent
c245a199b6
commit
d060296ade
74 files changed
+5901
-334
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { PLAYER_AGGRO_ID } from "../game/aggro";
|
||||
import type { ActiveAura, AuraDefinition } from "../game/combatAuras";
|
||||
import { auraDisplaysInPlayerStatusPanel } from "./PlayerStatusPanel";
|
||||
|
||||
function activeAura(
|
||||
targetId: string,
|
||||
durationMs: number | null,
|
||||
expiresAt: number | null = durationMs === null ? null : 10_000 + durationMs,
|
||||
hideFromAuraStrip = false,
|
||||
): ActiveAura {
|
||||
const definition: AuraDefinition = {
|
||||
id: `aura-${targetId}`,
|
||||
name: "Test Aura",
|
||||
disposition: "buff",
|
||||
durationMs,
|
||||
...(hideFromAuraStrip ? { hideFromAuraStrip: true } : {}),
|
||||
};
|
||||
return {
|
||||
instanceId: `instance-${targetId}`,
|
||||
definition,
|
||||
sourceId: PLAYER_AGGRO_ID,
|
||||
targetId,
|
||||
appliedAt: 10_000,
|
||||
expiresAt,
|
||||
stacks: 1,
|
||||
absorbs: [],
|
||||
procStates: [],
|
||||
};
|
||||
}
|
||||
|
||||
describe("top-right status visibility", () => {
|
||||
const now = 20_000;
|
||||
const partyTargets = new Set(["party-1"]);
|
||||
|
||||
it("shows every player aura and centralizes long-term party auras", () => {
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura(PLAYER_AGGRO_ID, 15_000), now, partyTargets)).toBe(true);
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura("party-1", 60_000), now, partyTargets)).toBe(true);
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura("party-1", null), now, partyTargets)).toBe(true);
|
||||
});
|
||||
|
||||
it("leaves short party effects on party frames and rejects unrelated, hidden, or expired auras", () => {
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura("party-1", 30_000), now, partyTargets)).toBe(false);
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura("stranger", 60_000), now, partyTargets)).toBe(false);
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura(PLAYER_AGGRO_ID, 60_000, 70_000, true), now, partyTargets)).toBe(false);
|
||||
expect(auraDisplaysInPlayerStatusPanel(activeAura(PLAYER_AGGRO_ID, 5_000, 15_000), now, partyTargets)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user