refactor: Overhaul nodes-testing setup - Part 3 (no-changelog) (#14967)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-04-29 17:42:21 +02:00
committed by GitHub
parent 3e43f9f8bc
commit 979f9e6327
241 changed files with 1868 additions and 2013 deletions

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
};
@@ -9,6 +8,7 @@ const API_RESPONSE = {
describe('Test SlackV2, channel => append', () => {
nock('https://slack.com').post('/api/conversations.archive').reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/channel/archive.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['archive.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channel: {
@@ -48,6 +47,7 @@ const API_RESPONSE = {
describe('Test SlackV2, channel => create', () => {
nock('https://slack.com').post('/api/conversations.create').reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/channel/create.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['create.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channel: {
@@ -49,6 +48,7 @@ describe('Test SlackV2, channel => get', () => {
.post('/api/conversations.info?channel=C085WNEHP4Y')
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/channel/get.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['get.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channels: [
@@ -114,6 +113,7 @@ describe('Test SlackV2, channel => getAll', () => {
)
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/channel/getAll.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['getAll.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
messages: [
@@ -171,6 +170,7 @@ describe('Test SlackV2, channel => history', () => {
.get('/api/conversations.history?channel=C08514ZPKB8&inclusive=true&page=1&limit=100')
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/channel/history.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['history.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
describe('Test SlackV2, file => upload', () => {
nock('https://slack.com')
.get('/api/files.getUploadURLExternal?filename=test%20_name.txt&length=25')
@@ -11,6 +10,7 @@ describe('Test SlackV2, file => upload', () => {
.post('/api/files.completeUploadExternal')
.reply(200, { ok: true, files: [{ id: 'file_id' }] });
const workflows = ['nodes/Slack/test/v2/node/file/upload.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['upload.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
@@ -11,6 +10,7 @@ const API_RESPONSE = {
describe('Test SlackV2, message => delete', () => {
nock('https://slack.com').post('/api/chat.delete').reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/message/delete.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['delete.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
permalink: 'https://myspace-qhg7381.slack.com/archives/C08514ZPKB8/p1734322671726339',
@@ -13,6 +12,7 @@ describe('Test SlackV2, message => getPermalink', () => {
.get('/api/chat.getPermalink?channel=C08514ZPKB8&message_ts=1734322671.726339')
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/message/getPermalink.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['getPermalink.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
@@ -61,6 +60,7 @@ describe('Test SlackV2, message => post', () => {
})
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/message/post.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['post.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
query: 'test in:test-002',
@@ -205,6 +204,7 @@ describe('Test SlackV2, message => search', () => {
.post('/api/search.messages?query=test%20in%3Atest-002&sort=timestamp&sort_dir=desc&count=2')
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/message/search.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['search.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
const API_RESPONSE = {
ok: true,
channel: 'C08514ZPKB8',
@@ -62,6 +61,7 @@ describe('Test SlackV2, message => update', () => {
})
.reply(200, API_RESPONSE);
const workflows = ['nodes/Slack/test/v2/node/message/update.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['update.workflow.json'],
});
});

View File

@@ -1,7 +1,6 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
describe('Test SlackV2, user => updateProfile', () => {
nock('https://slack.com')
.post('/api/users.profile.set', {
@@ -21,6 +20,7 @@ describe('Test SlackV2, user => updateProfile', () => {
})
.reply(200, { profile: { test: 'OK' } });
const workflows = ['nodes/Slack/test/v2/node/user/updateProfile.workflow.json'];
testWorkflows(workflows);
new NodeTestHarness().setupTests({
workflowFiles: ['updateProfile.workflow.json'],
});
});