diff --git a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.test.ts b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.test.ts index ec85066474..2d5449e93d 100644 --- a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.test.ts +++ b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.test.ts @@ -51,7 +51,7 @@ describe('WorkflowExecutionsCard', () => { retryOf: '2', retrySuccessId: null, }, - false, + true, ], [ { diff --git a/packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts b/packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts index 29bd64ea42..465abeb173 100644 --- a/packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts +++ b/packages/editor-ui/src/composables/__tests__/useExecutionHelpers.test.ts @@ -47,4 +47,25 @@ describe('useExecutionHelpers()', () => { ); }); }); + + describe('isExecutionRetriable', () => { + const { isExecutionRetriable } = useExecutionHelpers(); + + it.each(['crashed', 'error'])('returns true when execution status is %s', (status) => { + expect(isExecutionRetriable({ status } as ExecutionSummary)).toEqual(true); + }); + + it.each(['canceled', 'new', 'running', 'success', 'unknown', 'waiting'])( + 'returns false when execution status is %s', + (status) => { + expect(isExecutionRetriable({ status } as ExecutionSummary)).toEqual(false); + }, + ); + + it('should return false if retrySuccessId is set', () => { + expect( + isExecutionRetriable({ status: 'crashed', retrySuccessId: '123' } as ExecutionSummary), + ).toEqual(false); + }); + }); }); diff --git a/packages/editor-ui/src/composables/useExecutionHelpers.ts b/packages/editor-ui/src/composables/useExecutionHelpers.ts index a00f5b639a..9740f8dc06 100644 --- a/packages/editor-ui/src/composables/useExecutionHelpers.ts +++ b/packages/editor-ui/src/composables/useExecutionHelpers.ts @@ -62,11 +62,7 @@ export function useExecutionHelpers() { } function isExecutionRetriable(execution: ExecutionSummary): boolean { - return ( - ['crashed', 'error'].includes(execution.status) && - !execution.retryOf && - !execution.retrySuccessId - ); + return ['crashed', 'error'].includes(execution.status) && !execution.retrySuccessId; } return {