import test from 'node:test'; import assert from 'node:assert/strict'; import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; test('sidebar links wenfan xiaobao as an independent entry before xiaobao warning', () => { const sidebar = readFileSync(join(process.cwd(), 'components/layout/Sidebar.tsx'), 'utf8'); const askIndex = sidebar.indexOf("label: '问翻小宝'"); const warningIndex = sidebar.indexOf("label: '小宝预警'"); assert.notEqual(askIndex, -1); assert.notEqual(warningIndex, -1); assert.ok(askIndex < warningIndex); assert.match(sidebar, /path: '\/wenfan-xiaobao'/); }); test('wenfan xiaobao page provides records, chat, and voice input surfaces', () => { const pagePath = join(process.cwd(), 'app/wenfan-xiaobao/page.tsx'); assert.equal(existsSync(pagePath), true); const page = readFileSync(pagePath, 'utf8'); assert.match(page, /历史记录/); assert.match(page, /对话/); assert.match(page, /textarea/); assert.match(page, /Mic/); assert.match(page, /lg:grid-cols-\[300px_minmax\(0,1fr\)\]/); assert.match(page, /rounded-\[28px\]/); assert.doesNotMatch(page, /: 'border-\[var\(--line\)\] bg-\[var\(--bg\)\]/); assert.match(page, /: 'bg-white hover:bg-\[var\(--bg-subtle\)\]'/); });