mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Handle connections for missing nodes in a workflow (#13362)
This commit is contained in:
committed by
GitHub
parent
6ef9ae1862
commit
1e5feb195d
@@ -2201,7 +2201,7 @@ describe('Workflow', () => {
|
||||
expect(result).toEqual([targetNode.name]);
|
||||
});
|
||||
|
||||
test('should handle connections to nodes not defined in workflow', () => {
|
||||
test('should handle connections to nodes that are not defined in the workflow', () => {
|
||||
const node1 = createNode('Node1');
|
||||
const targetNode = createNode('TargetNode');
|
||||
|
||||
@@ -2226,6 +2226,31 @@ describe('Workflow', () => {
|
||||
|
||||
expect(result).toEqual([targetNode.name]);
|
||||
});
|
||||
|
||||
test('should handle connections from nodes that are not defined in the workflow', () => {
|
||||
const node1 = createNode('Node1');
|
||||
const targetNode = createNode('TargetNode');
|
||||
|
||||
const connections = {
|
||||
Node1: {
|
||||
main: [[{ node: 'TargetNode', type: NodeConnectionType.Main, index: 0 }]],
|
||||
},
|
||||
NonExistentNode: {
|
||||
main: [[{ node: 'TargetNode', type: NodeConnectionType.Main, index: 0 }]],
|
||||
},
|
||||
};
|
||||
|
||||
const workflow = new Workflow({
|
||||
id: 'test',
|
||||
nodes: [node1, targetNode],
|
||||
connections,
|
||||
active: false,
|
||||
nodeTypes,
|
||||
});
|
||||
|
||||
const result = workflow.getHighestNode(targetNode.name);
|
||||
expect(result).toEqual([node1.name]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getParentMainInputNode', () => {
|
||||
|
||||
Reference in New Issue
Block a user