feat(ui): redesign grouped application shell
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user