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' }, ]) }) })