fix: restore mobile menu active contrast
This commit is contained in:
1 parent
d8c3508db2
commit
61b1dbe350
3 files changed
+13
-3
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -81,7 +81,7 @@ export function MobilePortalMenu({ nav, sectionLabel }: Readonly<MobilePortalMen
|
||||
href={item.href}
|
||||
aria-current={active ? "page" : undefined}
|
||||
className={active
|
||||
? "flex min-h-11 items-center rounded-lg bg-foreground px-3 font-semibold text-background"
|
||||
? "mobile-portal-menu-active flex min-h-11 items-center rounded-lg px-3 font-semibold"
|
||||
: "flex min-h-11 items-center rounded-lg px-3 font-medium hover:bg-[var(--soft)]"}
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user