import { describe, expect, it } from "vitest";
import { freshParty } from "./data";
import { advanceHealingEffects } from "./healerEffects";

describe("healing effect advancement", () => {
  it("does not count resource-generating healing ticks on defeated members", () => {
    const fallen = {
      ...freshParty("druid", "Aelia")[0],
      hp: 0,
      healingEffects: [{
        id: "rejuvenation" as const,
        expiresAt: 5,
        nextTickAt: 1,
        tickInterval: 1,
        healingPerTick: 8,
        stacks: 1,
      }],
    };

    const advanced = advanceHealingEffects(fallen, 0, 3, 1);

    expect(advanced.member.hp).toBe(0);
    expect(advanced.tickCount).toBe(0);
    expect(advanced.tickCounts.rejuvenation).toBeUndefined();
  });
});
