mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
41 lines
985 B
TypeScript
41 lines
985 B
TypeScript
import type { IHttpRequestMethods } from 'n8n-workflow';
|
|
import nock from 'nock';
|
|
|
|
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
|
|
|
const API_RESPONSE = {
|
|
ok: true,
|
|
};
|
|
|
|
jest.mock('../../../../V2/GenericFunctions', () => {
|
|
const originalModule = jest.requireActual('../../../../V2/GenericFunctions');
|
|
return {
|
|
...originalModule,
|
|
slackApiRequest: jest.fn(async function (method: IHttpRequestMethods) {
|
|
if (method === 'POST') {
|
|
return API_RESPONSE;
|
|
}
|
|
}),
|
|
};
|
|
});
|
|
|
|
describe('Test SlackV2, channel => append', () => {
|
|
const workflows = ['nodes/Slack/test/v2/node/channel/archive.workflow.json'];
|
|
const tests = workflowToTests(workflows);
|
|
|
|
beforeAll(() => {
|
|
nock.disableNetConnect();
|
|
});
|
|
|
|
afterAll(() => {
|
|
nock.restore();
|
|
jest.unmock('../../../../V2/GenericFunctions');
|
|
});
|
|
|
|
const nodeTypes = setup(tests);
|
|
|
|
for (const testData of tests) {
|
|
test(testData.description, async () => await equalityTest(testData, nodeTypes));
|
|
}
|
|
});
|