本仓 2026-08-12 从 ssw main (192.168.1.18:13300/ssw/ssw-mvp) 的 dacli/ subpath 抽取,作为独立仓托管到 gitea:3000/ssw/dacli.git。 - 工作树为 ssw main dacli subpath 最新版 (110 commit, 08-12) - 历史未带 ssw main 整体历史(避免大仓污染) - 此为新仓基线 commit,未来以本仓历史为主
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: '' })
|
|
})
|
|
})
|