feat(editor): Expose View Execution links for erroneous sub-executions (#13185)

This commit is contained in:
Charlie Kolb
2025-02-13 09:44:52 +01:00
committed by GitHub
parent 85deff0b7f
commit 11cf1cd23a
14 changed files with 261 additions and 13 deletions

View 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);
});
});
});