diff --git a/solvway-admin-portal/app/components/app/Breadcrumbs.trail.test.tsx b/solvway-admin-portal/app/components/app/Breadcrumbs.trail.test.tsx deleted file mode 100644 index 72b241d..0000000 --- a/solvway-admin-portal/app/components/app/Breadcrumbs.trail.test.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { render, screen } from "@testing-library/react"; -import { afterEach, describe, expect, it, vi } from "vitest"; -import type { SidebarLink } from "@/app/lib/aclSidebar"; - -// refine-visitor-pages-and-shell: no trail on a leaf's own page (the page title says it already). - -const state = vi.hoisted(() => ({ links: [] as SidebarLink[], pathname: "/" })); - -vi.mock("next/navigation", () => ({ usePathname: () => state.pathname })); -vi.mock("@/app/lib/useAclSidebar", () => ({ useAclSidebar: () => state.links })); - -import Breadcrumbs from "./Breadcrumbs"; - -const LINKS: SidebarLink[] = [ - { - name: "Event", - url: "", - children: [{ name: "Events", url: "/events", children: [] }], - }, -]; - -afterEach(() => { - state.pathname = "/"; -}); - -describe("Breadcrumbs trail without repeats", () => { - it("shows no trail on the Events list", () => { - state.links = LINKS; - state.pathname = "/events"; - - const { container } = render(); - - expect(container).toBeEmptyDOMElement(); - }); - - it("shows Events as a link to the list on the new event page", () => { - state.links = LINKS; - state.pathname = "/events/new"; - - render(); - - expect(screen.getByRole("link", { name: "Events" })).toHaveAttribute("href", "/events"); - }); -});