From 61b1dbe350aaaeb3b2e290d5a51ec47b6abe8b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Tonh=C3=A4user?= Date: Tue, 11 Aug 2026 18:01:16 +0200 Subject: [PATCH] fix: restore mobile menu active contrast --- src/app/globals.css | 5 +++++ src/components/layout/mobile-portal-menu.test.tsx | 9 +++++++-- src/components/layout/mobile-portal-menu.tsx | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) 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)} >