(opts: {
metadataUseDraftState?: boolean
isDeployedContext?: boolean
})
| 390 | |
| 391 | describe('DAGExecutor createExecutionContext useDraftState', () => { |
| 392 | function buildMetadataUseDraftState(opts: { |
| 393 | metadataUseDraftState?: boolean |
| 394 | isDeployedContext?: boolean |
| 395 | }): boolean | undefined { |
| 396 | const executor = new DAGExecutor({ |
| 397 | workflow: { version: '1', blocks: [], connections: [] }, |
| 398 | contextExtensions: { |
| 399 | workspaceId: 'ws-1', |
| 400 | isDeployedContext: opts.isDeployedContext, |
| 401 | metadata: |
| 402 | opts.metadataUseDraftState === undefined |
| 403 | ? undefined |
| 404 | : ({ useDraftState: opts.metadataUseDraftState } as ExecutionContext['metadata']), |
| 405 | }, |
| 406 | }) |
| 407 | const { context } = ( |
| 408 | executor as unknown as { |
| 409 | createExecutionContext: (workflowId: string) => { context: ExecutionContext } |
| 410 | } |
| 411 | ).createExecutionContext('wf-1') |
| 412 | return context.metadata.useDraftState |
| 413 | } |
| 414 | |
| 415 | it('honors explicit useDraftState=true even when isDeployedContext is true (table dispatcher)', () => { |
| 416 | expect( |
no test coverage detected