This commit is contained in:
2026-07-12 21:26:08 +08:00
commit 9dd41afd48
502 changed files with 129901 additions and 0 deletions
@@ -0,0 +1,17 @@
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
describe("Sidebar V2 source contract", () => {
it("keeps expanded notebook rows text-first without leading book icons", () => {
const source = readFileSync(resolve(import.meta.dirname, "../src/components/Sidebar.tsx"), "utf8");
const kbItemStart = source.indexOf("function KbItem");
const conversationStart = source.indexOf("function ConversationItem");
assert.ok(kbItemStart >= 0 && conversationStart > kbItemStart);
const kbItemSource = source.slice(kbItemStart, conversationStart);
assert.match(kbItemSource, /className=\{cn\("kb-row"/);
assert.doesNotMatch(kbItemSource, /<BookOpen\b/);
});
});