File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,20 @@ describe('shouldAssignExecuteMethod', () => {
5858 expect ( shouldAssignExecuteMethod ( nodeType ) ) . toBe ( true ) ;
5959 } ) ;
6060
61- it ( 'should return false when node has methods' , ( ) => {
61+ it ( 'should return false when node has methods and is not declarative ' , ( ) => {
6262 const nodeType = {
6363 methods : { } ,
6464 } as unknown as INodeType ;
6565
6666 expect ( shouldAssignExecuteMethod ( nodeType ) ) . toBe ( false ) ;
6767 } ) ;
68+
69+ it ( 'should return true when node has methods but is declarative' , ( ) => {
70+ const nodeType = {
71+ description : { requestDefaults : { } } , // Declarative node
72+ methods : { } ,
73+ } as unknown as INodeType ;
74+
75+ expect ( shouldAssignExecuteMethod ( nodeType ) ) . toBe ( true ) ;
76+ } ) ;
6877} ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,6 @@ export const shouldAssignExecuteMethod = (nodeType: INodeType) => {
8989 ! nodeType . poll &&
9090 ! nodeType . trigger &&
9191 ( ! nodeType . webhook || isDeclarativeNode ) &&
92- ! nodeType . methods
92+ ( ! nodeType . methods || isDeclarativeNode )
9393 ) ;
9494} ;
You can’t perform that action at this time.
0 commit comments