mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(editor): Fix execution retry button (#10275)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
parent
57d1c9a99e
commit
55f2ffe256
|
@ -51,7 +51,7 @@ describe('WorkflowExecutionsCard', () => {
|
|||
retryOf: '2',
|
||||
retrySuccessId: null,
|
||||
},
|
||||
false,
|
||||
true,
|
||||
],
|
||||
[
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue