mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(Wait Node): Fix for hasNextPage in waiting forms (#12636)
This commit is contained in:
@@ -5,9 +5,16 @@ import type {
|
||||
INode,
|
||||
IWebhookFunctions,
|
||||
MultiPartFormData,
|
||||
NodeTypeAndVersion,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { formWebhook, prepareFormData, prepareFormReturnItem, resolveRawData } from '../utils';
|
||||
import {
|
||||
formWebhook,
|
||||
prepareFormData,
|
||||
prepareFormReturnItem,
|
||||
resolveRawData,
|
||||
isFormConnected,
|
||||
} from '../utils';
|
||||
|
||||
describe('FormTrigger, formWebhook', () => {
|
||||
beforeEach(() => {
|
||||
@@ -721,3 +728,36 @@ describe('resolveRawData', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('FormTrigger, isFormConnected', () => {
|
||||
it('should return false if Wait node is connected but resume parameter is not form', async () => {
|
||||
const result = isFormConnected([
|
||||
mock<NodeTypeAndVersion>({
|
||||
type: 'n8n-nodes-base.wait',
|
||||
parameters: {
|
||||
resume: 'timeInterval',
|
||||
},
|
||||
}),
|
||||
]);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
it('should return true if Wait node is connected and resume parameter is form', async () => {
|
||||
const result = isFormConnected([
|
||||
mock<NodeTypeAndVersion>({
|
||||
type: 'n8n-nodes-base.wait',
|
||||
parameters: {
|
||||
resume: 'form',
|
||||
},
|
||||
}),
|
||||
]);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
it('should return true if Form node is connected', async () => {
|
||||
const result = isFormConnected([
|
||||
mock<NodeTypeAndVersion>({
|
||||
type: 'n8n-nodes-base.form',
|
||||
}),
|
||||
]);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user