import { describe, it, expect, beforeEach } from "vitest";
import { navItemFactory } from "@/__factories__/nav-item.factory";

describe("navItemFactory", () => {
  beforeEach(() => navItemFactory.reset());

  it("returns a HeaderItem with stable defaults", () => {
    const item = navItemFactory.build();
    expect(item.label).toBe("Item 1");
    expect(item.href).toBe("/item-1");
    expect(item.external).toBe(false);
  });

  it("applies overrides", () => {
    const item = navItemFactory.build({ label: "Home", href: "/", external: true });
    expect(item.label).toBe("Home");
    expect(item.href).toBe("/");
    expect(item.external).toBe(true);
  });

  it("increments sequence per build", () => {
    const a = navItemFactory.build();
    const b = navItemFactory.build();
    expect(a.label).toBe("Item 1");
    expect(b.label).toBe("Item 2");
    expect(a.href).toBe("/item-1");
    expect(b.href).toBe("/item-2");
  });
});
