- dacli/ 整目录被 .gitignore 忽略,本次 force-add 其业务源码(766 文件) - 排除 node_modules/.env(含 PGPASSWORD 等敏感信息)/.DS_Store/__pycache__/*.pyc - 新增 dacli/.gitignore 长期管理内部噪声,新增文件仍需 git add -f - 根 .gitignore 补充 .cache/ 与诊断脚本忽略,并加 dacli 段说明
26 lines
901 B
TypeScript
26 lines
901 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { resolveCurrentUserIdentity } from '../../src/commands/workflow/_approver_resolve.ts'
|
|
|
|
describe('workflow current user identity', () => {
|
|
it('reads the real nested CurrentUser response shape', () => {
|
|
const identity = resolveCurrentUserIdentity({
|
|
menuList: [],
|
|
userInfo: {
|
|
userId: '349057407209541',
|
|
userName: '管理员',
|
|
userAccount: 'admin',
|
|
},
|
|
})
|
|
|
|
expect(identity).toEqual({ id: '349057407209541', name: '管理员' })
|
|
})
|
|
|
|
it('keeps compatibility with flat CurrentUser responses', () => {
|
|
expect(resolveCurrentUserIdentity({ userId: 'u1', realName: 'Alice' })).toEqual({ id: 'u1', name: 'Alice' })
|
|
})
|
|
|
|
it('returns empty identity when no user id is available', () => {
|
|
expect(resolveCurrentUserIdentity({ userInfo: { userId: '' } })).toEqual({ id: '', name: '' })
|
|
})
|
|
})
|