vicky469_aside/tests/sidebarThoughtTrailSource.test.ts
vicky469 d126027923 feat(sidebar): add mode tabs, thread groups, thought trail source
- Extract sidebar mode tabs into sidebarModeTabs.ts
- Extract thread groups into sidebarThreadGroups.ts
- Extract thought trail source into sidebarThoughtTrailSource.ts
- Remove non-working Tags tab and Tags radio button from thought trail
- Remove redundant Related Files h4 heading from thought trail section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 17:19:32 +08:00

24 lines
1.1 KiB
TypeScript

import * as assert from "node:assert/strict";
import test from "node:test";
import {
getDefaultThoughtTrailSource,
normalizeThoughtTrailSource,
resolveAvailableThoughtTrailSource,
} from "../src/ui/views/sidebarThoughtTrailSource";
test("getDefaultThoughtTrailSource starts fresh views from wikilinks", () => {
assert.equal(getDefaultThoughtTrailSource(), "wikilinks");
});
test("normalizeThoughtTrailSource accepts only supported sources", () => {
assert.equal(normalizeThoughtTrailSource("wikilinks"), "wikilinks");
assert.equal(normalizeThoughtTrailSource("tags"), "tags");
assert.equal(normalizeThoughtTrailSource("links"), null);
assert.equal(normalizeThoughtTrailSource(undefined), null);
});
test("resolveAvailableThoughtTrailSource falls back to wikilinks when tag graph is unavailable", () => {
assert.equal(resolveAvailableThoughtTrailSource("tags", false), "wikilinks");
assert.equal(resolveAvailableThoughtTrailSource("tags", true), "tags");
assert.equal(resolveAvailableThoughtTrailSource("wikilinks", false), "wikilinks");
});