cmvr-wms/ruoyi-ui-vue3/tests/runtime/archive-cost-validation.spec.js
lixiaolong f8f286d2a1 feat(assistant): 新增用户核对功能并优化对话流程
- 新增 user.check 功能用于核对人员是否已有系统账号
- 在 assistant-table-layout.js 中为用户表格添加 checkedIdentity 和 matchResult 字段
- 优化 AssistantConversationService 中的任务记忆和澄清流程
- 支持对草稿特定行进行修改,无需重新填写整张表
- 限制 user.check 操作最大查询数量为 100 条记录
- 实现中断任务恢复机制,保持原始请求上下文
- 添加针对多行数据选择性修改的目标行标识支持
2026-10-27 09:04:41 +08:00

10 lines
1.1 KiB
JavaScript

import {expect,it} from 'vitest'
import {emptyCost} from '@/views/archive/archive-model'
import {costIssues,matchesPerson} from '@/views/archive/archive-cost-validation'
it('zero amounts are valid and missing dates identify the exact section, row and input',()=>{
const form=emptyCost();form.income=0;form.labor=[{userId:2,name:'人员',duty:'研发',days:0,rate:0}];form.travel=[{userId:2,purpose:'出差',date:null,amount:0}];expect(costIssues(form)).toEqual([{key:'travel:0:date',label:'差旅费第 1 行:请选择出差日期'}]);form.travel[0].date='2026-10-26';expect(costIssues(form)).toEqual([])
})
it('admin is hidden by reserved ID or account while ordinary names are searched normally',()=>{
expect(matchesPerson({id:1,name:'任意姓名',account:'root'},'')).toBe(false);expect(matchesPerson({id:99,name:'管理员',account:'ADMIN'},'admin')).toBe(false);expect(matchesPerson({id:2,name:'王一',account:'wangyi'},'王')).toBe(true);expect(matchesPerson({id:2,name:'王一',account:'wangyi'},'li')).toBe(false);expect(matchesPerson({id:2,name:'管理员',account:'regular'},'')).toBe(true)
})