import { describe, expect, it } from "vitest";
import { bottomTabsFor, cycleBottomTab } from "./bottomTabs";

describe("bottom display tabs", () => {
  it("replaces Pack with PVP only during a PVP run", () => {
    expect(bottomTabsFor("hockey-healing-pvp")).toEqual(["combat", "map", "pvp"]);
    expect(bottomTabsFor("hockey-healing")).toEqual(["combat", "map", "pack"]);
    expect(bottomTabsFor("encounter")).toEqual(["combat", "map", "pack"]);
  });

  it("cycles every controller-accessible PVP tab", () => {
    expect(cycleBottomTab("combat", "hockey-healing-pvp")).toBe("map");
    expect(cycleBottomTab("map", "hockey-healing-pvp")).toBe("pvp");
    expect(cycleBottomTab("pvp", "hockey-healing-pvp")).toBe("combat");
  });

  it("recovers to the first valid tab after a mode changes", () => {
    expect(cycleBottomTab("pack", "hockey-healing-pvp")).toBe("combat");
    expect(cycleBottomTab("pvp", "encounter")).toBe("combat");
  });
});
