收口账号菜单侧栏导航

This commit is contained in:
baiyanyun
2026-06-12 16:33:18 +08:00
parent 81d2797035
commit 6323987a0d
10 changed files with 458 additions and 71 deletions

View File

@@ -0,0 +1,32 @@
import { describe, expect, it } from "vitest";
import {
ACCOUNT_MENU_KEYS,
PRIMARY_NAV_KEYS,
getAccountMenuAction,
} from "./sidebarNavigation";
describe("sidebar navigation", () => {
it("keeps only client, overview, and sessions in the primary sidebar", () => {
expect(PRIMARY_NAV_KEYS).toEqual(["client", "overview", "sessions"]);
});
it("maps account menu entries to internal navigation or commands", () => {
expect(ACCOUNT_MENU_KEYS).toEqual([
"settings",
"appearance",
"helpFeedback",
"checkUpdate",
"logout",
]);
expect(getAccountMenuAction("settings")).toEqual({ tab: "settings" });
expect(getAccountMenuAction("appearance")).toEqual({
tab: "settings",
settingsFocus: "appearance",
});
expect(getAccountMenuAction("helpFeedback")).toEqual({ tab: "about" });
expect(getAccountMenuAction("checkUpdate")).toEqual({
command: "checkUpdate",
});
expect(getAccountMenuAction("logout")).toEqual({ command: "logout" });
});
});