mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
chore: More tests for Workflow.ts (#13349)
This commit is contained in:
committed by
GitHub
parent
81282bd5c0
commit
1d03c2c8ca
@@ -458,7 +458,6 @@ export class Workflow {
|
||||
*/
|
||||
getHighestNode(
|
||||
nodeName: string,
|
||||
type: NodeConnectionType = NodeConnectionType.Main,
|
||||
nodeConnectionIndex?: number,
|
||||
checkedNodes?: string[],
|
||||
): string[] {
|
||||
@@ -473,7 +472,7 @@ export class Workflow {
|
||||
return currentHighest;
|
||||
}
|
||||
|
||||
if (!this.connectionsByDestinationNode[nodeName].hasOwnProperty(type)) {
|
||||
if (!this.connectionsByDestinationNode[nodeName].hasOwnProperty(NodeConnectionType.Main)) {
|
||||
// Node does not have incoming connections of given type
|
||||
return currentHighest;
|
||||
}
|
||||
@@ -493,14 +492,15 @@ export class Workflow {
|
||||
let connectionsByIndex: IConnection[] | null;
|
||||
for (
|
||||
let connectionIndex = 0;
|
||||
connectionIndex < this.connectionsByDestinationNode[nodeName][type].length;
|
||||
connectionIndex < this.connectionsByDestinationNode[nodeName][NodeConnectionType.Main].length;
|
||||
connectionIndex++
|
||||
) {
|
||||
if (nodeConnectionIndex !== undefined && nodeConnectionIndex !== connectionIndex) {
|
||||
// If a connection-index is given ignore all other ones
|
||||
continue;
|
||||
}
|
||||
connectionsByIndex = this.connectionsByDestinationNode[nodeName][type][connectionIndex];
|
||||
connectionsByIndex =
|
||||
this.connectionsByDestinationNode[nodeName][NodeConnectionType.Main][connectionIndex];
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
connectionsByIndex?.forEach((connection) => {
|
||||
if (checkedNodes.includes(connection.node)) {
|
||||
@@ -508,7 +508,7 @@ export class Workflow {
|
||||
return;
|
||||
}
|
||||
|
||||
addNodes = this.getHighestNode(connection.node, type, undefined, checkedNodes);
|
||||
addNodes = this.getHighestNode(connection.node, undefined, checkedNodes);
|
||||
|
||||
if (addNodes.length === 0) {
|
||||
// The checked node does not have any further parents so add it
|
||||
|
||||
Reference in New Issue
Block a user