Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
igatanasov committed Dec 9, 2024
1 parent 5865d9b commit c28c7b8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions, INode, INodeExecutionData } from 'n8n-workflow';

import { ExecuteWorkflowTrigger } from '../ExecuteWorkflowTrigger.node';
import { ExecuteWorkflowTrigger } from './ExecuteWorkflowTrigger.node';

describe('ExecuteWorkflowTrigger', () => {
it('should return its input data on V1', async () => {
const mockInputData: INodeExecutionData[] = [
{ json: { item: 0, foo: 'bar' } },
{ json: { item: 1, foo: 'quz' } },
];
const mockNode = { typeVersion: 1 } as INode;
const mockNode = mock<INode>({ typeVersion: 1 });
const executeFns = mock<IExecuteFunctions>({
getInputData: () => mockInputData,
getNode: () => mockNode,
getNodeParameter: jest.fn(),
});

executeFns.getNodeParameter.mockReturnValueOnce('passthrough');
const result = await new ExecuteWorkflowTrigger().execute.call(executeFns);

expect(result).toEqual([mockInputData]);
Expand Down

0 comments on commit c28c7b8

Please sign in to comment.