import { describe, expect, it } from "vitest";
import { BOSS_DEFINITIONS } from "./bossCatalog";
import { canAddBossToEncounter, normalizeEncounterBossIds } from "./bossSelection";

describe("boss encounter selection", () => {
  it("allows only one Memory Sequence boss in an encounter", () => {
    expect(canAddBossToEncounter(["sandglass-scorpion"], "crystal-bat-matriarch")).toBe(false);
    expect(canAddBossToEncounter(["sandglass-scorpion"], "rimeclaw-yeti")).toBe(false);
    expect(canAddBossToEncounter(["sandglass-scorpion"], "bulldrome")).toBe(true);

    const normalized = normalizeEncounterBossIds([
      "sandglass-scorpion",
      "crystal-bat-matriarch",
      "bulldrome",
      "rimeclaw-yeti",
    ]);
    expect(normalized).toEqual(["sandglass-scorpion", "bulldrome"]);
    expect(normalized.filter((bossId) => BOSS_DEFINITIONS[bossId].mechanicIds.includes("memory-sequence"))).toHaveLength(1);
  });
});
