feat(Airtable Node): Overhaul (#6200)
This commit is contained in:
35
packages/nodes-base/nodes/Airtable/test/v2/node/helpers.ts
Normal file
35
packages/nodes-base/nodes/Airtable/test/v2/node/helpers.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
|
||||
|
||||
import { get } from 'lodash';
|
||||
import { constructExecutionMetaData } from 'n8n-core';
|
||||
|
||||
export const node: INode = {
|
||||
id: '11',
|
||||
name: 'Airtable node',
|
||||
typeVersion: 2,
|
||||
type: 'n8n-nodes-base.airtable',
|
||||
position: [42, 42],
|
||||
parameters: {
|
||||
operation: 'create',
|
||||
},
|
||||
};
|
||||
|
||||
export const createMockExecuteFunction = (nodeParameters: IDataObject) => {
|
||||
const fakeExecuteFunction = {
|
||||
getNodeParameter(
|
||||
parameterName: string,
|
||||
_itemIndex: number,
|
||||
fallbackValue?: IDataObject | undefined,
|
||||
options?: IGetNodeParameterOptions | undefined,
|
||||
) {
|
||||
const parameter = options?.extractValue ? `${parameterName}.value` : parameterName;
|
||||
return get(nodeParameters, parameter, fallbackValue);
|
||||
},
|
||||
getNode() {
|
||||
return node;
|
||||
},
|
||||
helpers: { constructExecutionMetaData },
|
||||
continueOnFail: () => false,
|
||||
} as unknown as IExecuteFunctions;
|
||||
return fakeExecuteFunction;
|
||||
};
|
||||
Reference in New Issue
Block a user