fix(core): Prevent node param resolution from failing telemetry graph generation (#9257)

This commit is contained in:
Iván Ovejero
2024-04-30 11:39:24 +02:00
committed by GitHub
parent 96f02bd655
commit f6c9493355
2 changed files with 27 additions and 9 deletions

View File

@@ -5,8 +5,10 @@ import {
getDomainBase,
getDomainPath,
} from '@/TelemetryHelpers';
import type { IWorkflowBase } from '@/index';
import { ApplicationError, STICKY_NODE_TYPE, type IWorkflowBase } from '@/index';
import { nodeTypes } from './ExpressionExtensions/Helpers';
import { mock } from 'jest-mock-extended';
import * as nodeHelpers from '@/NodeHelpers';
describe('getDomainBase should return protocol plus domain', () => {
test('in valid URLs', () => {
@@ -763,6 +765,16 @@ describe('generateNodesGraph', () => {
webhookNodeNames: [],
});
});
test('should not fail on error to resolve a node parameter for sticky node type', () => {
const workflow = mock<IWorkflowBase>({ nodes: [{ type: STICKY_NODE_TYPE }] });
jest.spyOn(nodeHelpers, 'getNodeParameters').mockImplementationOnce(() => {
throw new ApplicationError('Could not find property option');
});
expect(() => generateNodesGraph(workflow, nodeTypes)).not.toThrow();
});
});
function validUrls(idMaker: typeof alphanumericId | typeof email, char = CHAR) {