nexus/ui/src/lib/instance-settings.test.ts
Nexus Dev 6924de3e08 refactor(nexus): drop dangling chat surfaces and settings whitelist entries (phase 16b)
- Delete ChatSearchDialog and ChatBookmarkList (orphaned after
  ChatPanel deletion in Phase 16a; grep confirmed zero consumers).
- Remove /instance/settings/heartbeats and /instance/settings/
  experimental from the normalizeRememberedInstanceSettingsPath
  whitelist; Phase 13 collapsed those pages into /general but
  left the whitelist entries behind.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:07:27 +00:00

31 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
DEFAULT_INSTANCE_SETTINGS_PATH,
normalizeRememberedInstanceSettingsPath,
} from "./instance-settings";
describe("normalizeRememberedInstanceSettingsPath", () => {
it("keeps known instance settings pages", () => {
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/general")).toBe(
"/instance/settings/general",
);
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/plugins/example?tab=config#logs")).toBe(
"/instance/settings/plugins/example?tab=config#logs",
);
});
it("falls back to the default page for unknown paths", () => {
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/nope")).toBe(
DEFAULT_INSTANCE_SETTINGS_PATH,
);
// Phase 16b: /heartbeats and /experimental no longer exist as
// separate settings pages — they collapse into /general.
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/heartbeats")).toBe(
DEFAULT_INSTANCE_SETTINGS_PATH,
);
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/experimental")).toBe(
DEFAULT_INSTANCE_SETTINGS_PATH,
);
expect(normalizeRememberedInstanceSettingsPath(null)).toBe(DEFAULT_INSTANCE_SETTINGS_PATH);
});
});