tdd7 复盘发现 16 项待固化能力, 本批 (P0) 入库: - workflow 审批人 chain 中 addCommand(assignApprovers|handle|sign) 源码与单测 8 个文件已在 index.ts 引用, 但 HEAD 缺失, clean checkout 会 import 失败 本批将 src/commands/workflow/assignApprovers.ts / handle.ts / sign.ts 及 7 个 workflow_*.test.ts 全部入主干 - src/commands/test/run.ts: 拆分 evalBusinessRule 与 resolveBusinessRuleTarget, now/today 关键字 (今日 23:59:59.999) 走毫秒值, 单次测试运行冻结同一时间 - src/commands/test/browser.ts: 增 --screenshot-dir 选项 + screenshots 字段 落地, workflow 定向 TC-B 改调 resolveCurrentUserIdentity 统一解析 - src/commands/test/browser-evidence.ts: 新增文件, 截图路径计划 / 原子化 capture / md5 哈希 / 去重校验, 衔接铁律 4 截图证据 - 4 个补充单测: business_rule_dates / browser_evidence / workflow_* 8 个 全部通过 636 用例, tsc --noEmit 0 错误
19 lines
847 B
TypeScript
19 lines
847 B
TypeScript
import { describe, expect, it, vi } from 'vitest'
|
|
import { getLaunchOperatorList } from '../../src/commands/workflow/launch.ts'
|
|
|
|
describe('workflow launch operator lookup', () => {
|
|
it('queries web categories without the wrong template-id filter and matches the launched task locally', async () => {
|
|
const getList = vi.fn()
|
|
.mockResolvedValueOnce({ list: [{ id: 'other', taskId: 'otherTask', handleId: 9 }] })
|
|
.mockResolvedValueOnce({ list: [{ id: 'todo1', taskId: 'task1', handleId: 2 }] })
|
|
|
|
const result = await getLaunchOperatorList(getList, { flowId: 'template1', taskId: 'task1' })
|
|
|
|
expect(getList).toHaveBeenNthCalledWith(1, { category: 0 })
|
|
expect(getList).toHaveBeenNthCalledWith(2, { category: 1 })
|
|
expect(result).toEqual([
|
|
{ id: 'todo1', taskId: 'task1', handleId: 2, userId: '2' },
|
|
])
|
|
})
|
|
})
|