import { describe, expect, it } from "vitest";
import { getHeaderVisibility, resolveHeaderMode } from "@/lib/layout/header";

describe("layout header mode", () => {
  it("returns public mode for guests in auto mode", () => {
    expect(resolveHeaderMode(false, "auto")).toBe("public");
  });

  it("returns module mode only for authenticated users", () => {
    expect(resolveHeaderMode(true, "module")).toBe("module");
    expect(resolveHeaderMode(false, "module")).toBe("public");
  });

  it("exposes visibility flags for module header", () => {
    const visibility = getHeaderVisibility(true, "module");

    expect(visibility.mode).toBe("module");
    expect(visibility.showBackLink).toBe(true);
    expect(visibility.showUserControls).toBe(true);
    expect(visibility.showMarketingNav).toBe(false);
    expect(visibility.showAuthButtons).toBe(false);
  });
});
