mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Overhaul nodes-testing setup - Part 3 (no-changelog) (#14967)
This commit is contained in:
committed by
GitHub
parent
3e43f9f8bc
commit
979f9e6327
@@ -1,12 +1,11 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import { NodeConnectionTypes, type WorkflowTestData } from 'n8n-workflow';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import * as Helpers from '@test/nodes/Helpers';
|
||||
|
||||
import { microsoftEntraApiResponse, microsoftEntraNodeResponse } from './mocks';
|
||||
|
||||
describe('Microsoft Entra Node', () => {
|
||||
const baseUrl = 'https://graph.microsoft.com/v1.0';
|
||||
const testHarness = new NodeTestHarness();
|
||||
|
||||
describe('Group description', () => {
|
||||
const tests: WorkflowTestData[] = [
|
||||
@@ -73,7 +72,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [microsoftEntraNodeResponse.createGroup],
|
||||
},
|
||||
@@ -165,7 +163,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [microsoftEntraNodeResponse.deleteGroup],
|
||||
},
|
||||
@@ -236,7 +233,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [microsoftEntraNodeResponse.getGroup],
|
||||
},
|
||||
@@ -353,7 +349,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [microsoftEntraNodeResponse.getGroupWithProperties],
|
||||
},
|
||||
@@ -421,7 +416,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [new Array(102).fill(microsoftEntraNodeResponse.getGroup[0])],
|
||||
},
|
||||
@@ -503,7 +497,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [new Array(10).fill(microsoftEntraNodeResponse.getGroup[0])],
|
||||
},
|
||||
@@ -612,7 +605,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [
|
||||
new Array(102).fill(microsoftEntraNodeResponse.getGroupWithProperties[0]),
|
||||
@@ -711,7 +703,6 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
},
|
||||
output: {
|
||||
nodeExecutionOrder: ['Start'],
|
||||
nodeData: {
|
||||
'Micosoft Entra ID': [microsoftEntraNodeResponse.updateGroup],
|
||||
},
|
||||
@@ -751,14 +742,8 @@ describe('Microsoft Entra Node', () => {
|
||||
},
|
||||
];
|
||||
|
||||
test.each(tests)('$description', async (testData) => {
|
||||
const { result } = await executeWorkflow(testData);
|
||||
|
||||
const resultNodeData = Helpers.getResultNodeData(result, testData);
|
||||
resultNodeData.forEach(({ nodeName, resultData }) =>
|
||||
expect(resultData).toEqual(testData.output.nodeData[nodeName]),
|
||||
);
|
||||
expect(result.status).toEqual('success');
|
||||
});
|
||||
for (const testData of tests) {
|
||||
testHarness.setupTest(testData);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user