fix(editor): Fix parameter reset on credential change in Discord node (#9137)

This commit is contained in:
Elias Meire
2024-04-18 14:56:04 +02:00
committed by GitHub
parent 23a2dd08b6
commit 135ef75add
2 changed files with 42 additions and 11 deletions

View File

@@ -3,6 +3,8 @@ import { getVisibleSelect } from '../utils';
import { MANUAL_TRIGGER_NODE_DISPLAY_NAME } from '../constants';
import { NDV, WorkflowPage } from '../pages';
import { NodeCreator } from '../pages/features/node-creator';
import { clickCreateNewCredential } from '../composables/ndv';
import { setCredentialValues } from '../composables/modals/credential-modal';
const workflowPage = new WorkflowPage();
const ndv = new NDV();
@@ -633,7 +635,7 @@ describe('NDV', () => {
ndv.getters.nodeRunErrorIndicator().should('exist');
});
it('Should handle mismatched option attributes', () => {
it('Should clear mismatched collection parameters', () => {
workflowPage.actions.addInitialNodeToCanvas('LDAP', {
keepNdvOpen: true,
action: 'Create a new entry',
@@ -656,6 +658,21 @@ describe('NDV', () => {
ndv.getters.resourceLocatorInput('documentId').find('input').should('have.value', TEST_DOC_ID);
});
it('Should not clear resource/operation after credential change', () => {
workflowPage.actions.addInitialNodeToCanvas('Discord', {
keepNdvOpen: true,
action: 'Delete a message',
});
clickCreateNewCredential();
setCredentialValues({
botToken: 'sk_test_123',
});
ndv.getters.parameterInput('resource').find('input').should('have.value', 'Message');
ndv.getters.parameterInput('operation').find('input').should('have.value', 'Delete');
});
it('Should open appropriate node creator after clicking on connection hint link', () => {
const nodeCreator = new NodeCreator();
const hintMapper = {