22 lines
1.2 KiB
TypeScript
22 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { UI_ACTION_IDS, UI_ID_PATTERNS, UI_NAV_IDS, getCommandPaletteActionId, getCommandPaletteRecentId, getCommandPaletteResultId } from "./uiRegistry";
|
|
|
|
describe("UI_NAV_IDS", () => {
|
|
it("exposes the app notification nav id", () => {
|
|
expect(UI_NAV_IDS.appNotifications).toBe("ui.nav.app.notifications");
|
|
});
|
|
|
|
it("keeps desktop and mobile search triggers independently addressable", () => {
|
|
expect(UI_ACTION_IDS.search).toBe("ui.action.shell.search");
|
|
expect(UI_ACTION_IDS.searchMobile).toBe("ui.action.shell.searchMobile");
|
|
expect(UI_ACTION_IDS.searchMobile).not.toBe(UI_ACTION_IDS.search);
|
|
});
|
|
|
|
it("builds stable, unique Spotlight row ids from the registered patterns", () => {
|
|
expect(UI_ID_PATTERNS.commandPaletteResult).toBe("ui.surface.commandPalette.result.{entityType}.{entityId}");
|
|
expect(getCommandPaletteResultId("project", "project-42")).toBe("ui.surface.commandPalette.result.project.project42");
|
|
expect(getCommandPaletteRecentId("recent-42")).toBe("ui.surface.commandPalette.recent.recent42");
|
|
expect(getCommandPaletteActionId("open-settings")).toBe("ui.surface.commandPalette.action.openSettings");
|
|
});
|
|
});
|