diff --git a/src/app/globals.css b/src/app/globals.css index 7a989da..8082b86 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -199,6 +199,11 @@ a { animation: mobile-portal-menu-enter 150ms ease-out; } +.mobile-portal-menu-active { + background: var(--ink); + color: var(--paper); +} + @keyframes mobile-portal-menu-enter { from { opacity: 0; diff --git a/src/components/layout/mobile-portal-menu.test.tsx b/src/components/layout/mobile-portal-menu.test.tsx index 8c3fd3e..bbab662 100644 --- a/src/components/layout/mobile-portal-menu.test.tsx +++ b/src/components/layout/mobile-portal-menu.test.tsx @@ -31,8 +31,13 @@ test("opens every mobile portal action and marks the most specific active route" fireEvent.click(trigger); expect(trigger.getAttribute("aria-expanded")).toBe("true"); - expect(screen.getByRole("link", { name: "Dashboard" })).toBeTruthy(); - expect(screen.getByRole("link", { name: "Redaktionen" }).getAttribute("aria-current")).toBe("page"); + const inactiveLink = screen.getByRole("link", { name: "Dashboard" }); + const activeLink = screen.getByRole("link", { name: "Redaktionen" }); + + expect(inactiveLink).toBeTruthy(); + expect(activeLink.getAttribute("aria-current")).toBe("page"); + expect(activeLink.getAttribute("class")).toContain("mobile-portal-menu-active"); + expect(inactiveLink.getAttribute("class")).not.toContain("mobile-portal-menu-active"); expect(screen.getByRole("link", { name: "Abrechnungen" })).toBeTruthy(); expect(screen.getByRole("link", { name: "Audit" })).toBeTruthy(); expect(screen.getByRole("button", { name: /design umschalten/i })).toBeTruthy(); diff --git a/src/components/layout/mobile-portal-menu.tsx b/src/components/layout/mobile-portal-menu.tsx index ccf9f32..83b1a53 100644 --- a/src/components/layout/mobile-portal-menu.tsx +++ b/src/components/layout/mobile-portal-menu.tsx @@ -81,7 +81,7 @@ export function MobilePortalMenu({ nav, sectionLabel }: Readonly setOpen(false)} >