mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
fix(core): Show correct error messages when nodes can't be used in an expression (#16549)
This commit is contained in:
@@ -519,7 +519,7 @@ describe('WorkflowExecute', () => {
|
|||||||
// ┌───────┐1 ┌─────┐1 ┌─────┐
|
// ┌───────┐1 ┌─────┐1 ┌─────┐
|
||||||
// │trigger├──────►node1├──────►node2│
|
// │trigger├──────►node1├──────►node2│
|
||||||
// └───────┘ └─────┘ └─────┘
|
// └───────┘ └─────┘ └─────┘
|
||||||
test('removes disabled nodes from the workflow', async () => {
|
test('removes disabled nodes from the runNodeFilter, but not the graph', async () => {
|
||||||
// ARRANGE
|
// ARRANGE
|
||||||
const waitPromise = createDeferredPromise<IRun>();
|
const waitPromise = createDeferredPromise<IRun>();
|
||||||
const additionalData = Helpers.WorkflowExecuteAdditionalData(waitPromise);
|
const additionalData = Helpers.WorkflowExecuteAdditionalData(waitPromise);
|
||||||
@@ -555,11 +555,17 @@ describe('WorkflowExecute', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// ASSERT
|
// ASSERT
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const runNodeFilter: string[] = (workflowExecute as any).runExecutionData.startData
|
||||||
|
?.runNodeFilter;
|
||||||
|
expect(runNodeFilter).toContain(trigger.name);
|
||||||
|
expect(runNodeFilter).toContain(node2.name);
|
||||||
|
expect(runNodeFilter).not.toContain(node1.name);
|
||||||
expect(processRunExecutionDataSpy).toHaveBeenCalledTimes(1);
|
expect(processRunExecutionDataSpy).toHaveBeenCalledTimes(1);
|
||||||
const nodes = Object.keys(processRunExecutionDataSpy.mock.calls[0][0].nodes);
|
const nodes = Object.keys(processRunExecutionDataSpy.mock.calls[0][0].nodes);
|
||||||
expect(nodes).toContain(trigger.name);
|
expect(nodes).toContain(trigger.name);
|
||||||
expect(nodes).toContain(node2.name);
|
expect(nodes).toContain(node2.name);
|
||||||
expect(nodes).not.toContain(node1.name);
|
expect(nodes).toContain(node1.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ►►
|
// ►►
|
||||||
|
|||||||
@@ -473,7 +473,11 @@ export class WorkflowExecute {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.processRunExecutionData(graph.toWorkflow({ ...workflow }));
|
// Still passing the original workflow here, because the WorkflowDataProxy
|
||||||
|
// needs it to create more useful error messages, e.g. differentiate
|
||||||
|
// between a node not being connected to the node referencing it or a node
|
||||||
|
// not existing in the workflow.
|
||||||
|
return this.processRunExecutionData(workflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user