import { menuItems } from "../constants/menuItems.js";

describe("menuItems constant", () => {
  it("should be an array", () => {
    expect(Array.isArray(menuItems)).toBe(true);
  });

  it("should contain Dashboard menu item", () => {
    const dashboard = menuItems.find((item) => item.Menu_Name === "Dashboard");
    expect(dashboard).toBeDefined();
    expect(dashboard.Path).toBe("/dashboard");
    expect(dashboard.Icon).toBe("DashboardIcon");
  });

  it("should contain Users List menu item", () => {
    const usersList = menuItems.find((item) => item.Menu_Name === "Users List");
    expect(usersList).toBeDefined();
    expect(usersList.Path).toBe("/users");
  });

  it("should contain Activity Reports menu item", () => {
    const activityReports = menuItems.find(
      (item) => item.Menu_Name === "Activity Reports"
    );
    expect(activityReports).toBeDefined();
    expect(activityReports.Path).toBe("/activity-report");
  });

  it("should contain Manage Users menu item", () => {
    const manageUsers = menuItems.find(
      (item) => item.Menu_Name === "Manage Users"
    );
    expect(manageUsers).toBeDefined();
    expect(manageUsers.Path).toBe("/manage-users");
  });

  it("should contain Manage Roles menu item", () => {
    const manageRoles = menuItems.find(
      (item) => item.Menu_Name === "Manage Roles"
    );
    expect(manageRoles).toBeDefined();
    expect(manageRoles.Path).toBe("/manage-roles");
  });

  it("should have ShowInMenu property for all items", () => {
    menuItems.forEach((item) => {
      expect(item).toHaveProperty("ShowInMenu");
    });
  });

  it("should have Icon property for all items", () => {
    menuItems.forEach((item) => {
      expect(item).toHaveProperty("Icon");
    });
  });

  it("should have Path property for all items", () => {
    menuItems.forEach((item) => {
      expect(item).toHaveProperty("Path");
      expect(typeof item.Path).toBe("string");
    });
  });

  it("should have Permission_Id property for all items", () => {
    menuItems.forEach((item) => {
      expect(item).toHaveProperty("Permission_Id");
    });
  });
});
