- aiConversationHtmlRenderer 识别单据记录类表格并渲染为卡片列表,新增删除申请单详情的禁用占位链接 - aiWorkbenchConversationStore 增加草稿删除后会话链接失效处理,避免点击已删除单据跳转 - aiApplicationPreviewActions 调整提交/草稿调用路径,PersonalWorkbenchAiMode 接入新的会话存储与渲染 - ConfirmDialog/TravelRequestDeleteDialog/useAppShell/AppShellRouteView 配套适配,同步更新相关前端测试
61 lines
2.7 KiB
JavaScript
61 lines
2.7 KiB
JavaScript
import assert from 'node:assert/strict'
|
|
import { readFileSync } from 'node:fs'
|
|
import test from 'node:test'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const appShell = readFileSync(
|
|
fileURLToPath(new URL('../src/views/AppShellRouteView.vue', import.meta.url)),
|
|
'utf8'
|
|
)
|
|
const appShellComposable = readFileSync(
|
|
fileURLToPath(new URL('../src/composables/useAppShell.js', import.meta.url)),
|
|
'utf8'
|
|
)
|
|
const workbench = readFileSync(
|
|
fileURLToPath(new URL('../src/components/business/PersonalWorkbench.vue', import.meta.url)),
|
|
'utf8'
|
|
)
|
|
const aiMode = readFileSync(
|
|
fileURLToPath(new URL('../src/components/business/PersonalWorkbenchAiMode.vue', import.meta.url)),
|
|
'utf8'
|
|
)
|
|
|
|
test('workbench document detail keeps workbench as the return target', () => {
|
|
assert.match(workbench, /source:\s*'workbench'/)
|
|
assert.match(workbench, /returnTo:\s*'workbench'/)
|
|
assert.match(appShell, /:back-label="detailBackLabel"/)
|
|
assert.match(appShell, /String\(payload\.returnTo \|\| ''\)\.trim\(\) === 'workbench'/)
|
|
assert.match(appShell, /String\(payload\.source \|\| ''\)\.trim\(\) === 'workbench'/)
|
|
assert.match(appShell, /const detailPayload = request \|\| \{[\s\S]*detailLookupOnly:\s*true[\s\S]*\}/)
|
|
assert.match(appShell, /openRequestDetail\(detailPayload,\s*\{ returnTo \}\)/)
|
|
assert.match(appShellComposable, /const detailReturnTarget = computed/)
|
|
assert.match(appShellComposable, /detailReturnTarget\.value === 'workbench' \? '返回首页' : '返回单据中心'/)
|
|
assert.match(appShellComposable, /nextQuery\.returnTo = 'workbench'/)
|
|
assert.match(appShellComposable, /router\.push\(\{ name: 'app-workbench' \}\)/)
|
|
assert.match(appShellComposable, /router\.push\(\{ name: 'app-documents', query: buildDocumentReturnQuery\(\) \}\)/)
|
|
})
|
|
|
|
test('AI detail links wait for full document detail instead of rendering a half snapshot', () => {
|
|
assert.match(aiMode, /detailLookupOnly:\s*true/)
|
|
assert.match(aiMode, /params\.get\('claim_id'\)/)
|
|
assert.match(aiMode, /params\.get\('claim_no'\)/)
|
|
assert.match(aiMode, /claimId:\s*claimId \|\| reference/)
|
|
assert.match(aiMode, /claimNo:\s*claimNo \|\| reference/)
|
|
assert.match(
|
|
appShell,
|
|
/v-else-if="activeView === 'documents' && detailMode && !selectedRequest"[\s\S]*正在加载完整单据详情/
|
|
)
|
|
assert.match(
|
|
appShell,
|
|
/const detailPayload = request \|\| \{[\s\S]*detailLookupOnly:\s*true[\s\S]*\}/
|
|
)
|
|
assert.match(
|
|
appShellComposable,
|
|
/const isDetailLookupOnlyRequest = isDetailLookupOnlyPayload\(request\)[\s\S]*selectedRequestSnapshot\.value = isDetailLookupOnlyRequest \? null : request \|\| null/
|
|
)
|
|
assert.match(
|
|
appShellComposable,
|
|
/void refreshSelectedRequestDetail\(isDetailLookupOnlyRequest \? requestId : request\)/
|
|
)
|
|
})
|