feat(ui): redesign grouped application shell

This commit is contained in:
cesnimda
2026-09-28 17:26:02 +02:00
parent 57a6bd02c6
commit 8e56ceabf5
30 changed files with 398 additions and 92 deletions
+26 -1
View File
@@ -1,4 +1,5 @@
import { activeNavTo } from "./layout/AppShell";
import React from "react";
import { activeNavItemTo, activeNavTo, type NavItem } from "./layout/AppShell";
// Route ownership under test (the real sidebar entries):
// /career -> Career Workspace
@@ -41,3 +42,27 @@ describe("sidebar active nav ownership", () => {
}
});
});
describe("grouped sidebar ownership", () => {
const items: NavItem[] = [
{ to: "/jobs", activeFor: ["/applications"], label: "Jobs", icon: React.createElement("span"), children: [
{ to: "/kanban", label: "Board", icon: React.createElement("span") },
{ to: "/trash", label: "Trash", icon: React.createElement("span") },
] },
{ to: "/career", label: "Career profile", icon: React.createElement("span") },
{ to: "/career/builder", label: "CVs", icon: React.createElement("span") },
];
test("non-nested Jobs destinations select their actual secondary owner", () => {
expect(activeNavItemTo("/kanban", items)).toBe("/kanban");
expect(activeNavItemTo("/trash", items)).toBe("/trash");
});
test("legacy application details retain Jobs ownership", () => {
expect(activeNavItemTo("/applications/42", items)).toBe("/jobs");
});
test("CV editor routes never select Career Profile", () => {
expect(activeNavItemTo("/career/builder/42", items)).toBe("/career/builder");
});
});