mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor(core): Move single node check outside of the nodes loop (#16959)
This commit is contained in:
@@ -2586,6 +2586,25 @@ describe('Workflow', () => {
|
||||
|
||||
expect(workflow.getStartNode()).toBeUndefined();
|
||||
});
|
||||
|
||||
test('returns the single node when only one non-disabled node exists', () => {
|
||||
const singleNode = {
|
||||
name: 'SingleNode',
|
||||
type: 'test.set',
|
||||
typeVersion: 1,
|
||||
id: 'uuid-single',
|
||||
position: [0, 0],
|
||||
parameters: {},
|
||||
} as INode;
|
||||
const workflow = new Workflow({
|
||||
nodes: [singleNode],
|
||||
connections: {},
|
||||
active: false,
|
||||
nodeTypes,
|
||||
});
|
||||
|
||||
expect(workflow.getStartNode()).toBe(singleNode);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNode', () => {
|
||||
|
||||
Reference in New Issue
Block a user