first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
const API_RESPONSE = {
|
||||
ok: true,
|
||||
};
|
||||
|
||||
describe('Test SlackV2, channel => append', () => {
|
||||
nock('https://slack.com').post('/api/conversations.archive').reply(200, API_RESPONSE);
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['archive.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "slack tests",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "channel",
|
||||
"operation": "archive",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"value": "C084ZURRQPL",
|
||||
"mode": "list",
|
||||
"cachedResultName": "test-001"
|
||||
}
|
||||
},
|
||||
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"typeVersion": 2.3,
|
||||
"position": [1040, 360],
|
||||
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "Bg0bWXf8apAimCqJ",
|
||||
"name": "Slack account 2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "06652908-6b8e-443a-9508-ab229b011b73",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [1260, 360]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"No Operation, do nothing": [
|
||||
{
|
||||
"json": {
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Slack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "13de7d28-7e93-4602-a4d1-5389e8ccc4dc",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
|
||||
},
|
||||
"id": "qJdEfiBgYLdfYOTs",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
const API_RESPONSE = {
|
||||
ok: true,
|
||||
channel: {
|
||||
id: 'C085WNEHP4Y',
|
||||
name: 'test-003',
|
||||
is_channel: true,
|
||||
is_group: false,
|
||||
is_im: false,
|
||||
is_mpim: false,
|
||||
is_private: false,
|
||||
created: 1734325731,
|
||||
is_archived: false,
|
||||
is_general: false,
|
||||
unlinked: 0,
|
||||
name_normalized: 'test-003',
|
||||
is_shared: false,
|
||||
is_org_shared: false,
|
||||
is_pending_ext_shared: false,
|
||||
pending_shared: [],
|
||||
context_team_id: 'T0364MSFHV2',
|
||||
updated: 1734325731240,
|
||||
parent_conversation: null,
|
||||
creator: 'U0362BXQYJW',
|
||||
is_ext_shared: false,
|
||||
shared_team_ids: ['T0364MSFHV2'],
|
||||
pending_connected_team_ids: [],
|
||||
is_member: true,
|
||||
last_read: '0000000000.000000',
|
||||
topic: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
purpose: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
previous_names: [],
|
||||
priority: 0,
|
||||
},
|
||||
};
|
||||
|
||||
describe('Test SlackV2, channel => create', () => {
|
||||
nock('https://slack.com').post('/api/conversations.create').reply(200, API_RESPONSE);
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['create.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"name": "slack tests",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "channel",
|
||||
"channelId": "test-003"
|
||||
},
|
||||
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"typeVersion": 2.3,
|
||||
"position": [1040, 360],
|
||||
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "Bg0bWXf8apAimCqJ",
|
||||
"name": "Slack account 2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "06652908-6b8e-443a-9508-ab229b011b73",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [1260, 360]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"No Operation, do nothing": [
|
||||
{
|
||||
"json": {
|
||||
"id": "C085WNEHP4Y",
|
||||
"name": "test-003",
|
||||
"is_channel": true,
|
||||
"is_group": false,
|
||||
"is_im": false,
|
||||
"is_mpim": false,
|
||||
"is_private": false,
|
||||
"created": 1734325731,
|
||||
"is_archived": false,
|
||||
"is_general": false,
|
||||
"unlinked": 0,
|
||||
"name_normalized": "test-003",
|
||||
"is_shared": false,
|
||||
"is_org_shared": false,
|
||||
"is_pending_ext_shared": false,
|
||||
"pending_shared": [],
|
||||
"context_team_id": "T0364MSFHV2",
|
||||
"updated": 1734325731240,
|
||||
"parent_conversation": null,
|
||||
"creator": "U0362BXQYJW",
|
||||
"is_ext_shared": false,
|
||||
"shared_team_ids": ["T0364MSFHV2"],
|
||||
"pending_connected_team_ids": [],
|
||||
"is_member": true,
|
||||
"last_read": "0000000000.000000",
|
||||
"topic": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"purpose": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"previous_names": [],
|
||||
"priority": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Slack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "297d0c4b-32e6-4b08-8818-af5e64762521",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
|
||||
},
|
||||
"id": "qJdEfiBgYLdfYOTs",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
const API_RESPONSE = {
|
||||
ok: true,
|
||||
channel: {
|
||||
id: 'C085WNEHP4Y',
|
||||
name: 'test-003',
|
||||
is_channel: true,
|
||||
is_group: false,
|
||||
is_im: false,
|
||||
is_mpim: false,
|
||||
is_private: false,
|
||||
created: 1734325731,
|
||||
is_archived: false,
|
||||
is_general: false,
|
||||
unlinked: 0,
|
||||
name_normalized: 'test-003',
|
||||
is_shared: false,
|
||||
is_org_shared: false,
|
||||
is_pending_ext_shared: false,
|
||||
pending_shared: [],
|
||||
context_team_id: 'T0364MSFHV2',
|
||||
updated: 1734325731240,
|
||||
parent_conversation: null,
|
||||
creator: 'U0362BXQYJW',
|
||||
is_ext_shared: false,
|
||||
shared_team_ids: ['T0364MSFHV2'],
|
||||
pending_connected_team_ids: [],
|
||||
is_member: true,
|
||||
last_read: '0000000000.000000',
|
||||
topic: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
purpose: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
previous_names: [],
|
||||
},
|
||||
};
|
||||
|
||||
describe('Test SlackV2, channel => get', () => {
|
||||
nock('https://slack.com')
|
||||
.post('/api/conversations.info?channel=C085WNEHP4Y')
|
||||
.reply(200, API_RESPONSE);
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['get.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"name": "slack tests",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "channel",
|
||||
"operation": "get",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"value": "C085WNEHP4Y",
|
||||
"mode": "list",
|
||||
"cachedResultName": "test-003"
|
||||
},
|
||||
"options": {
|
||||
"includeNumMembers": true
|
||||
}
|
||||
},
|
||||
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"typeVersion": 2.3,
|
||||
"position": [1040, 360],
|
||||
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "Bg0bWXf8apAimCqJ",
|
||||
"name": "Slack account 2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "06652908-6b8e-443a-9508-ab229b011b73",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [1260, 360]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"No Operation, do nothing": [
|
||||
{
|
||||
"json": {
|
||||
"id": "C085WNEHP4Y",
|
||||
"name": "test-003",
|
||||
"is_channel": true,
|
||||
"is_group": false,
|
||||
"is_im": false,
|
||||
"is_mpim": false,
|
||||
"is_private": false,
|
||||
"created": 1734325731,
|
||||
"is_archived": false,
|
||||
"is_general": false,
|
||||
"unlinked": 0,
|
||||
"name_normalized": "test-003",
|
||||
"is_shared": false,
|
||||
"is_org_shared": false,
|
||||
"is_pending_ext_shared": false,
|
||||
"pending_shared": [],
|
||||
"context_team_id": "T0364MSFHV2",
|
||||
"updated": 1734325731240,
|
||||
"parent_conversation": null,
|
||||
"creator": "U0362BXQYJW",
|
||||
"is_ext_shared": false,
|
||||
"shared_team_ids": ["T0364MSFHV2"],
|
||||
"pending_connected_team_ids": [],
|
||||
"is_member": true,
|
||||
"last_read": "0000000000.000000",
|
||||
"topic": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"purpose": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"previous_names": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Slack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "753332eb-25d1-443a-acef-92993e89751a",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
|
||||
},
|
||||
"id": "qJdEfiBgYLdfYOTs",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
const API_RESPONSE = {
|
||||
ok: true,
|
||||
channels: [
|
||||
{
|
||||
id: 'C0362BX17TM',
|
||||
name: 'general',
|
||||
is_channel: true,
|
||||
is_group: false,
|
||||
is_im: false,
|
||||
is_mpim: false,
|
||||
is_private: false,
|
||||
created: 1646724991,
|
||||
is_archived: false,
|
||||
is_general: true,
|
||||
unlinked: 0,
|
||||
name_normalized: 'general',
|
||||
is_shared: false,
|
||||
is_org_shared: false,
|
||||
is_pending_ext_shared: false,
|
||||
pending_shared: [],
|
||||
context_team_id: 'T0364MSFHV2',
|
||||
updated: 1734075560630,
|
||||
parent_conversation: null,
|
||||
creator: 'U0362BXQYJW',
|
||||
is_ext_shared: false,
|
||||
shared_team_ids: ['T0364MSFHV2'],
|
||||
pending_connected_team_ids: [],
|
||||
is_member: true,
|
||||
topic: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
purpose: {
|
||||
value:
|
||||
'This is the one channel that will always include everyone. It’s a great spot for announcements and team-wide conversations.',
|
||||
creator: 'U0362BXQYJW',
|
||||
last_set: 1646724991,
|
||||
},
|
||||
properties: {
|
||||
use_case: 'welcome',
|
||||
},
|
||||
previous_names: [],
|
||||
num_members: 1,
|
||||
},
|
||||
{
|
||||
id: 'C0362BXRZQA',
|
||||
name: 'random',
|
||||
is_channel: true,
|
||||
is_group: false,
|
||||
is_im: false,
|
||||
is_mpim: false,
|
||||
is_private: false,
|
||||
created: 1646724991,
|
||||
is_archived: false,
|
||||
is_general: false,
|
||||
unlinked: 0,
|
||||
name_normalized: 'random',
|
||||
is_shared: false,
|
||||
is_org_shared: false,
|
||||
is_pending_ext_shared: false,
|
||||
pending_shared: [],
|
||||
context_team_id: 'T0364MSFHV2',
|
||||
updated: 1725415586388,
|
||||
parent_conversation: null,
|
||||
creator: 'U0362BXQYJW',
|
||||
is_ext_shared: false,
|
||||
shared_team_ids: ['T0364MSFHV2'],
|
||||
pending_connected_team_ids: [],
|
||||
is_member: true,
|
||||
topic: {
|
||||
value: '',
|
||||
creator: '',
|
||||
last_set: 0,
|
||||
},
|
||||
purpose: {
|
||||
value:
|
||||
'This channel is for... well, everything else. It’s a place for team jokes, spur-of-the-moment ideas, and funny GIFs. Go wild!',
|
||||
creator: 'U0362BXQYJW',
|
||||
last_set: 1646724991,
|
||||
},
|
||||
properties: {
|
||||
tabs: [
|
||||
{
|
||||
id: 'files',
|
||||
label: '',
|
||||
type: 'files',
|
||||
},
|
||||
],
|
||||
tabz: [
|
||||
{
|
||||
type: 'files',
|
||||
},
|
||||
],
|
||||
use_case: 'random',
|
||||
},
|
||||
previous_names: [],
|
||||
num_members: 2,
|
||||
},
|
||||
],
|
||||
response_metadata: {
|
||||
next_cursor: 'dGVhbTpDMDM2MkMyM1RSOA==',
|
||||
},
|
||||
};
|
||||
|
||||
describe('Test SlackV2, channel => getAll', () => {
|
||||
nock('https://slack.com')
|
||||
.get(
|
||||
'/api/conversations.list?types=public_channel%2Cprivate_channel%2Cim%2Cmpim&exclude_archived=true&limit=2',
|
||||
)
|
||||
.reply(200, API_RESPONSE);
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['getAll.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,181 @@
|
||||
{
|
||||
"name": "slack new tests",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "channel",
|
||||
"operation": "getAll",
|
||||
"limit": 2,
|
||||
"filters": {
|
||||
"excludeArchived": true,
|
||||
"types": ["public_channel", "private_channel", "im", "mpim"]
|
||||
}
|
||||
},
|
||||
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"typeVersion": 2.3,
|
||||
"position": [1040, 360],
|
||||
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "Bg0bWXf8apAimCqJ",
|
||||
"name": "Slack account 2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "06652908-6b8e-443a-9508-ab229b011b73",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [1260, 360]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"No Operation, do nothing": [
|
||||
{
|
||||
"json": {
|
||||
"id": "C0362BX17TM",
|
||||
"name": "general",
|
||||
"is_channel": true,
|
||||
"is_group": false,
|
||||
"is_im": false,
|
||||
"is_mpim": false,
|
||||
"is_private": false,
|
||||
"created": 1646724991,
|
||||
"is_archived": false,
|
||||
"is_general": true,
|
||||
"unlinked": 0,
|
||||
"name_normalized": "general",
|
||||
"is_shared": false,
|
||||
"is_org_shared": false,
|
||||
"is_pending_ext_shared": false,
|
||||
"pending_shared": [],
|
||||
"context_team_id": "T0364MSFHV2",
|
||||
"updated": 1734075560630,
|
||||
"parent_conversation": null,
|
||||
"creator": "U0362BXQYJW",
|
||||
"is_ext_shared": false,
|
||||
"shared_team_ids": ["T0364MSFHV2"],
|
||||
"pending_connected_team_ids": [],
|
||||
"is_member": true,
|
||||
"topic": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"purpose": {
|
||||
"value": "This is the one channel that will always include everyone. It’s a great spot for announcements and team-wide conversations.",
|
||||
"creator": "U0362BXQYJW",
|
||||
"last_set": 1646724991
|
||||
},
|
||||
"properties": {
|
||||
"use_case": "welcome"
|
||||
},
|
||||
"previous_names": [],
|
||||
"num_members": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"id": "C0362BXRZQA",
|
||||
"name": "random",
|
||||
"is_channel": true,
|
||||
"is_group": false,
|
||||
"is_im": false,
|
||||
"is_mpim": false,
|
||||
"is_private": false,
|
||||
"created": 1646724991,
|
||||
"is_archived": false,
|
||||
"is_general": false,
|
||||
"unlinked": 0,
|
||||
"name_normalized": "random",
|
||||
"is_shared": false,
|
||||
"is_org_shared": false,
|
||||
"is_pending_ext_shared": false,
|
||||
"pending_shared": [],
|
||||
"context_team_id": "T0364MSFHV2",
|
||||
"updated": 1725415586388,
|
||||
"parent_conversation": null,
|
||||
"creator": "U0362BXQYJW",
|
||||
"is_ext_shared": false,
|
||||
"shared_team_ids": ["T0364MSFHV2"],
|
||||
"pending_connected_team_ids": [],
|
||||
"is_member": true,
|
||||
"topic": {
|
||||
"value": "",
|
||||
"creator": "",
|
||||
"last_set": 0
|
||||
},
|
||||
"purpose": {
|
||||
"value": "This channel is for... well, everything else. It’s a place for team jokes, spur-of-the-moment ideas, and funny GIFs. Go wild!",
|
||||
"creator": "U0362BXQYJW",
|
||||
"last_set": 1646724991
|
||||
},
|
||||
"properties": {
|
||||
"tabs": [
|
||||
{
|
||||
"id": "files",
|
||||
"label": "",
|
||||
"type": "files"
|
||||
}
|
||||
],
|
||||
"tabz": [
|
||||
{
|
||||
"type": "files"
|
||||
}
|
||||
],
|
||||
"use_case": "random"
|
||||
},
|
||||
"previous_names": [],
|
||||
"num_members": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Slack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "f74e9c2c-83f4-4ef8-b436-704e1a27a9ef",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
|
||||
},
|
||||
"id": "qJdEfiBgYLdfYOTs",
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
const API_RESPONSE = {
|
||||
ok: true,
|
||||
messages: [
|
||||
{
|
||||
user: 'U0362BXQYJW',
|
||||
type: 'message',
|
||||
ts: '1734322597.935429',
|
||||
bot_id: 'B0382SHFM46',
|
||||
app_id: 'A037UTP0Z39',
|
||||
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
|
||||
team: 'T0364MSFHV2',
|
||||
bot_profile: {
|
||||
id: 'B0382SHFM46',
|
||||
deleted: false,
|
||||
name: 'blocks-test',
|
||||
updated: 1648028754,
|
||||
app_id: 'A037UTP0Z39',
|
||||
icons: {
|
||||
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
|
||||
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
|
||||
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
|
||||
},
|
||||
team_id: 'T0364MSFHV2',
|
||||
},
|
||||
blocks: [
|
||||
{
|
||||
type: 'rich_text',
|
||||
block_id: 'piR',
|
||||
elements: [
|
||||
{
|
||||
type: 'rich_text_section',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'test message\n',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
text: 'Automated with this ',
|
||||
style: {
|
||||
italic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
|
||||
text: 'n8n workflow',
|
||||
style: {
|
||||
italic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
user: 'U0362BXQYJW',
|
||||
type: 'message',
|
||||
ts: '1734322341.161179',
|
||||
bot_id: 'B0382SHFM46',
|
||||
app_id: 'A037UTP0Z39',
|
||||
text: 'test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_',
|
||||
team: 'T0364MSFHV2',
|
||||
bot_profile: {
|
||||
id: 'B0382SHFM46',
|
||||
app_id: 'A037UTP0Z39',
|
||||
name: 'blocks-test',
|
||||
icons: {
|
||||
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
|
||||
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
|
||||
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
|
||||
},
|
||||
deleted: false,
|
||||
updated: 1648028754,
|
||||
team_id: 'T0364MSFHV2',
|
||||
},
|
||||
blocks: [
|
||||
{
|
||||
type: 'rich_text',
|
||||
block_id: '2BN',
|
||||
elements: [
|
||||
{
|
||||
type: 'rich_text_section',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'test message\n',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
text: 'Automated with this ',
|
||||
style: {
|
||||
italic: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
url: 'http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd',
|
||||
text: 'n8n workflow',
|
||||
style: {
|
||||
italic: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
user: 'U0362BXQYJW',
|
||||
type: 'message',
|
||||
ts: '1734321960.507649',
|
||||
edited: {
|
||||
user: 'B0382SHFM46',
|
||||
ts: '1734324905.000000',
|
||||
},
|
||||
bot_id: 'B0382SHFM46',
|
||||
app_id: 'A037UTP0Z39',
|
||||
text: 'updated message',
|
||||
team: 'T0364MSFHV2',
|
||||
bot_profile: {
|
||||
id: 'B0382SHFM46',
|
||||
app_id: 'A037UTP0Z39',
|
||||
name: 'blocks-test',
|
||||
icons: {
|
||||
image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
|
||||
image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
|
||||
image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png',
|
||||
},
|
||||
deleted: false,
|
||||
updated: 1648028754,
|
||||
team_id: 'T0364MSFHV2',
|
||||
},
|
||||
blocks: [
|
||||
{
|
||||
type: 'rich_text',
|
||||
block_id: 'wR+',
|
||||
elements: [
|
||||
{
|
||||
type: 'rich_text_section',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'updated message',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
subtype: 'channel_join',
|
||||
user: 'U0362BXQYJW',
|
||||
text: '<@U0362BXQYJW> has joined the channel',
|
||||
type: 'message',
|
||||
ts: '1734321942.689159',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
describe('Test SlackV2, channel => history', () => {
|
||||
nock('https://slack.com')
|
||||
.get('/api/conversations.history?channel=C08514ZPKB8&inclusive=true&page=1&limit=100')
|
||||
.reply(200, API_RESPONSE);
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['history.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"name": "slack new tests",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "e679c883-1839-47dc-9511-8f7dc370e6b0",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "channel",
|
||||
"operation": "history",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"value": "C08514ZPKB8",
|
||||
"mode": "list",
|
||||
"cachedResultName": "test-002"
|
||||
},
|
||||
"returnAll": true,
|
||||
"filters": {
|
||||
"inclusive": true
|
||||
}
|
||||
},
|
||||
"id": "2e1937a6-4c8f-4cd1-ae42-11b2bd12cc4c",
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"typeVersion": 2.3,
|
||||
"position": [1040, 360],
|
||||
"webhookId": "04c5e584-45f4-48d0-bcd2-0ecacecb0f53",
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "Bg0bWXf8apAimCqJ",
|
||||
"name": "Slack account 2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "06652908-6b8e-443a-9508-ab229b011b73",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [1260, 360]
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"No Operation, do nothing": [
|
||||
{
|
||||
"json": {
|
||||
"user": "U0362BXQYJW",
|
||||
"type": "message",
|
||||
"ts": "1734322597.935429",
|
||||
"bot_id": "B0382SHFM46",
|
||||
"app_id": "A037UTP0Z39",
|
||||
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
|
||||
"team": "T0364MSFHV2",
|
||||
"bot_profile": {
|
||||
"id": "B0382SHFM46",
|
||||
"deleted": false,
|
||||
"name": "blocks-test",
|
||||
"updated": 1648028754,
|
||||
"app_id": "A037UTP0Z39",
|
||||
"icons": {
|
||||
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
|
||||
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
|
||||
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
|
||||
},
|
||||
"team_id": "T0364MSFHV2"
|
||||
},
|
||||
"blocks": [
|
||||
{
|
||||
"type": "rich_text",
|
||||
"block_id": "piR",
|
||||
"elements": [
|
||||
{
|
||||
"type": "rich_text_section",
|
||||
"elements": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "test message\n"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "Automated with this ",
|
||||
"style": {
|
||||
"italic": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
|
||||
"text": "n8n workflow",
|
||||
"style": {
|
||||
"italic": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"user": "U0362BXQYJW",
|
||||
"type": "message",
|
||||
"ts": "1734322341.161179",
|
||||
"bot_id": "B0382SHFM46",
|
||||
"app_id": "A037UTP0Z39",
|
||||
"text": "test message\n_Automated with this <http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd|n8n workflow>_",
|
||||
"team": "T0364MSFHV2",
|
||||
"bot_profile": {
|
||||
"id": "B0382SHFM46",
|
||||
"app_id": "A037UTP0Z39",
|
||||
"name": "blocks-test",
|
||||
"icons": {
|
||||
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
|
||||
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
|
||||
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
|
||||
},
|
||||
"deleted": false,
|
||||
"updated": 1648028754,
|
||||
"team_id": "T0364MSFHV2"
|
||||
},
|
||||
"blocks": [
|
||||
{
|
||||
"type": "rich_text",
|
||||
"block_id": "2BN",
|
||||
"elements": [
|
||||
{
|
||||
"type": "rich_text_section",
|
||||
"elements": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "test message\n"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "Automated with this ",
|
||||
"style": {
|
||||
"italic": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"url": "http://localhost:5678/workflow/qJdEfiBgYLdfYOTs?utm_source=n8n-internal&utm_medium=powered_by&utm_campaign=n8n-nodes-base.slack_be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd",
|
||||
"text": "n8n workflow",
|
||||
"style": {
|
||||
"italic": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"user": "U0362BXQYJW",
|
||||
"type": "message",
|
||||
"ts": "1734321960.507649",
|
||||
"edited": {
|
||||
"user": "B0382SHFM46",
|
||||
"ts": "1734324905.000000"
|
||||
},
|
||||
"bot_id": "B0382SHFM46",
|
||||
"app_id": "A037UTP0Z39",
|
||||
"text": "updated message",
|
||||
"team": "T0364MSFHV2",
|
||||
"bot_profile": {
|
||||
"id": "B0382SHFM46",
|
||||
"app_id": "A037UTP0Z39",
|
||||
"name": "blocks-test",
|
||||
"icons": {
|
||||
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
|
||||
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
|
||||
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
|
||||
},
|
||||
"deleted": false,
|
||||
"updated": 1648028754,
|
||||
"team_id": "T0364MSFHV2"
|
||||
},
|
||||
"blocks": [
|
||||
{
|
||||
"type": "rich_text",
|
||||
"block_id": "wR+",
|
||||
"elements": [
|
||||
{
|
||||
"type": "rich_text_section",
|
||||
"elements": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "updated message"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"subtype": "channel_join",
|
||||
"user": "U0362BXQYJW",
|
||||
"text": "<@U0362BXQYJW> has joined the channel",
|
||||
"type": "message",
|
||||
"ts": "1734321942.689159"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Slack": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "6b7102c7-d3c5-4b88-b67d-4ee6ae51b581",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "be251a83c052a9862eeac953816fbb1464f89dfbf79d7ac490a8e336a8cc8bfd"
|
||||
},
|
||||
"id": "qJdEfiBgYLdfYOTs",
|
||||
"tags": []
|
||||
}
|
||||
Reference in New Issue
Block a user