dsh-sansheng-liubu/test/nav.test.js

18 lines
899 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 左侧入口的静态契约:必须走宿主正式槽位 sidebar.panellist,且不再挂在「新会话」行。
import test from 'node:test'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const root = dirname(dirname(fileURLToPath(import.meta.url)))
test('左侧入口使用 sidebar.panellist,位置在记忆系统与更多之间(order 32)', async () => {
const source = await readFile(join(root, 'src/client/index.js'), 'utf8')
assert.match(source, /name: 'sidebar\.panellist'/)
assert.match(source, /order: NAV_ORDER/)
assert.match(source, /const NAV_ORDER = 32/)
assert.ok(!source.includes('sidebar.session.action'), '不得再占用新会话右侧槽位')
assert.ok(!source.includes('SanshengSessionAction'), '旧的新会话入口应已删除')
})