2026-05-20 21:00:47 +08:00
|
|
|
|
import assert from 'node:assert/strict'
|
|
|
|
|
|
import { readFileSync } from 'node:fs'
|
|
|
|
|
|
import test from 'node:test'
|
|
|
|
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
|
|
|
|
|
|
|
|
const workbench = readFileSync(
|
|
|
|
|
|
fileURLToPath(new URL('../src/components/business/PersonalWorkbench.vue', import.meta.url)),
|
|
|
|
|
|
'utf8'
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
test('workbench assistant greets the current employee without the old helper tag', () => {
|
|
|
|
|
|
assert.doesNotMatch(workbench, /assistant-tag/)
|
|
|
|
|
|
assert.doesNotMatch(workbench, /AI 报销助手/)
|
2026-05-25 13:35:39 +08:00
|
|
|
|
assert.match(workbench, /嗨,\{\{ assistantGreetingName \}\},描述您想做的事,AI 会直接帮您处理/)
|
|
|
|
|
|
assert.match(workbench, /我会自动识别您的意图,协助完成费用申请、报销、查询和制度问答等业务工作/)
|
2026-05-20 21:00:47 +08:00
|
|
|
|
assert.match(workbench, /const assistantGreetingName = computed/)
|
|
|
|
|
|
assert.match(workbench, /user\.name/)
|
|
|
|
|
|
})
|