fix(core): Fix populating of node custom api call options (#5347)

* feat(core): Fix populating of node custom api call options

* lint fixes

* Adress PR comments

* Add e2e test and only inject custom API options for latest version

* Make sure to injectCustomApiCallOption for the latest version of node

* feat(cli): Move apiCallOption injection to LoadNodesAndCredentials and add e2e tests to check for custom nodes credentials

* Load nodes and credentials fixtures from a single place

* Console warning if credential is invalid during customApiOptions injection
This commit is contained in:
OlegIvaniv
2023-02-03 13:14:59 +01:00
committed by GitHub
parent 4dab2fec49
commit 6985500a7d
16 changed files with 269 additions and 104 deletions

View File

@@ -1,6 +1,5 @@
import { NodeCreator } from '../pages/features/node-creator';
import { INodeTypeDescription } from 'n8n-workflow';
import CustomNodeFixture from '../fixtures/Custom_node.json';
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from '../constants';
import { randFirstName, randLastName } from '@ngneat/falso';
@@ -19,20 +18,6 @@ describe('Node Creator', () => {
beforeEach(() => {
cy.signin({ email, password });
cy.intercept('GET', '/types/nodes.json', (req) => {
// Delete caching headers so that we can intercept the request
['etag', 'if-none-match', 'if-modified-since'].forEach((header) => {
delete req.headers[header];
});
req.continue((res) => {
const nodes = res.body as INodeTypeDescription[];
nodes.push(CustomNodeFixture as INodeTypeDescription);
res.send(nodes);
});
}).as('nodesIntercept');
cy.visit(nodeCreatorFeature.url);
cy.waitForLoad();
});
@@ -153,6 +138,7 @@ describe('Node Creator', () => {
});
it('should render and select community node', () => {
cy.intercept('GET', '/types/nodes.json').as('nodesIntercept');
cy.wait('@nodesIntercept').then(() => {
const customCategory = 'Custom Category';
const customNode = 'E2E Node';