import { describe, expect, it } from "vitest";
import { normalizeDeveloperAccessPageSelection } from "./developerAccessPages";

describe("developer access pages", () => {
  it("collapses all non-all pages into all", () => {
    expect(
      normalizeDeveloperAccessPageSelection([
        "overview",
        "client_create",
        "audit",
      ]),
    ).toEqual(["all"]);
  });

  it("keeps partial selections as-is", () => {
    expect(
      normalizeDeveloperAccessPageSelection(["overview", "audit"]),
    ).toEqual(["overview", "audit"]);
  });

  it("keeps explicit all selection", () => {
    expect(normalizeDeveloperAccessPageSelection(["all"])).toEqual(["all"]);
  });
});
