test(Gmail Trigger Node): Add tests (no-changelog) (#11076)

This commit is contained in:
Elias Meire
2024-10-03 13:59:15 +02:00
committed by GitHub
parent 3974981ea5
commit fc26c44f65
4 changed files with 362 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
import { ExecuteWorkflowTrigger } from '../ExecuteWorkflowTrigger.node';
describe('ExecuteWorkflowTrigger', () => {
it('should return its input data', async () => {
const mockInputData: INodeExecutionData[] = [
{ json: { item: 0, foo: 'bar' } },
{ json: { item: 1, foo: 'quz' } },
];
const executeFns = mock<IExecuteFunctions>({
getInputData: () => mockInputData,
});
const result = await new ExecuteWorkflowTrigger().execute.call(executeFns);
expect(result).toEqual([mockInputData]);
});
});