mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-27 22:20:53 +00:00
fix(core): Assign execute method to declarative nodes even if they have methods property (#17796)
This commit is contained in:
@@ -58,11 +58,20 @@ describe('shouldAssignExecuteMethod', () => {
|
||||
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false when node has methods', () => {
|
||||
it('should return false when node has methods and is not declarative', () => {
|
||||
const nodeType = {
|
||||
methods: {},
|
||||
} as unknown as INodeType;
|
||||
|
||||
expect(shouldAssignExecuteMethod(nodeType)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true when node has methods but is declarative', () => {
|
||||
const nodeType = {
|
||||
description: { requestDefaults: {} }, // Declarative node
|
||||
methods: {},
|
||||
} as unknown as INodeType;
|
||||
|
||||
expect(shouldAssignExecuteMethod(nodeType)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -89,6 +89,6 @@ export const shouldAssignExecuteMethod = (nodeType: INodeType) => {
|
||||
!nodeType.poll &&
|
||||
!nodeType.trigger &&
|
||||
(!nodeType.webhook || isDeclarativeNode) &&
|
||||
!nodeType.methods
|
||||
(!nodeType.methods || isDeclarativeNode)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user