mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(editor): Expose View Execution links for erroneous sub-executions (#13185)
This commit is contained in:
30
packages/workflow/test/MetadataUtils.test.ts
Normal file
30
packages/workflow/test/MetadataUtils.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { parseErrorMetadata } from '@/MetadataUtils';
|
||||
|
||||
describe('MetadataUtils', () => {
|
||||
describe('parseMetadataFromError', () => {
|
||||
it('should return undefined if error does not have response', () => {
|
||||
const error = { message: 'An error occurred' };
|
||||
const result = parseErrorMetadata(error);
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should return undefined if error response does not have subworkflow data', () => {
|
||||
const error = { errorResponse: { someKey: 'someValue' } };
|
||||
const result = parseErrorMetadata(error);
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should return metadata if error response has subworkflow data', () => {
|
||||
const error = { errorResponse: { executionId: '123', workflowId: '456' } };
|
||||
const expectedMetadata = {
|
||||
subExecution: {
|
||||
executionId: '123',
|
||||
workflowId: '456',
|
||||
},
|
||||
subExecutionsCount: 1,
|
||||
};
|
||||
const result = parseErrorMetadata(error);
|
||||
expect(result).toEqual(expectedMetadata);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user