fix: Load remote resources even if expressions in non requried parameters resolve (#6987)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { WorkflowPage, NDV, CredentialsModal } from '../pages';
|
||||
import { getVisibleSelect } from '../utils';
|
||||
import { getPopper, getVisiblePopper, getVisibleSelect } from '../utils';
|
||||
|
||||
const workflowPage = new WorkflowPage();
|
||||
const ndv = new NDV();
|
||||
@@ -51,4 +51,19 @@ describe('Resource Locator', () => {
|
||||
ndv.actions.setRLCValue('documentId', '321');
|
||||
ndv.getters.resourceLocatorInput('sheetName').should('have.value', '');
|
||||
});
|
||||
|
||||
// unlike RMC and remote options, RLC does not support loadOptionDependsOn
|
||||
it('should retrieve list options when other params throw errors', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {action: 'Resource Locator'});
|
||||
|
||||
ndv.getters.resourceLocatorInput('rlc').click();
|
||||
getVisiblePopper().should('have.length', 1).findChildByTestId('rlc-item').should('have.length', 5);
|
||||
|
||||
ndv.actions.setInvalidExpression('fieldId');
|
||||
|
||||
ndv.getters.container().click(); // remove focus from input, hide expression preview
|
||||
|
||||
ndv.getters.resourceLocatorInput('rlc').click();
|
||||
getVisiblePopper().should('have.length', 1).findChildByTestId('rlc-item').should('have.length', 5);
|
||||
});
|
||||
});
|
||||
|
||||
32
cypress/e2e/28-resource-mapper.cy.ts
Normal file
32
cypress/e2e/28-resource-mapper.cy.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { WorkflowPage, NDV } from '../pages';
|
||||
|
||||
const workflowPage = new WorkflowPage();
|
||||
const ndv = new NDV();
|
||||
|
||||
describe('Resource Mapper', () => {
|
||||
beforeEach(() => {
|
||||
workflowPage.actions.visit();
|
||||
});
|
||||
|
||||
it('should not retrieve list options when required params throw errors', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {action: 'Resource Mapping Component'});
|
||||
|
||||
ndv.getters.resourceMapperFieldsContainer().should('be.visible').findChildByTestId('parameter-input').should('have.length', 2);
|
||||
|
||||
ndv.actions.setInvalidExpression('fieldId');
|
||||
|
||||
ndv.actions.refreshResourceMapperColumns();
|
||||
ndv.getters.resourceMapperFieldsContainer().should('not.exist');
|
||||
});
|
||||
|
||||
it('should retrieve list options when optional params throw errors', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {action: 'Resource Mapping Component'});
|
||||
|
||||
ndv.getters.resourceMapperFieldsContainer().should('be.visible').findChildByTestId('parameter-input').should('have.length', 2);
|
||||
|
||||
ndv.actions.setInvalidExpression('otherField');
|
||||
|
||||
ndv.actions.refreshResourceMapperColumns();
|
||||
ndv.getters.resourceMapperFieldsContainer().should('be.visible').findChildByTestId('parameter-input').should('have.length', 2);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
import { WorkflowPage, NDV } from '../pages';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { getPopper, getVisiblePopper, getVisibleSelect } from '../utils';
|
||||
|
||||
const workflowPage = new WorkflowPage();
|
||||
const ndv = new NDV();
|
||||
@@ -289,6 +290,38 @@ describe('NDV', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should not retrieve remote options when required params throw errors', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {action: 'Remote Options'});
|
||||
|
||||
ndv.getters.parameterInput('remoteOptions').click();
|
||||
getVisibleSelect().find('.el-select-dropdown__item').should('have.length', 3);
|
||||
|
||||
ndv.actions.setInvalidExpression('fieldId');
|
||||
|
||||
ndv.getters.container().click(); // remove focus from input, hide expression preview
|
||||
|
||||
ndv.getters.parameterInput('remoteOptions').click();
|
||||
getPopper().should('not.be.visible');
|
||||
|
||||
ndv.getters.parameterInputIssues('remoteOptions').realHover();
|
||||
getVisiblePopper().should('include.text', `node doesn't exist`);
|
||||
});
|
||||
|
||||
it('should retrieve remote options when non-required params throw errors', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {action: 'Remote Options'});
|
||||
|
||||
ndv.getters.parameterInput('remoteOptions').click();
|
||||
getVisibleSelect().find('.el-select-dropdown__item').should('have.length', 3);
|
||||
ndv.getters.parameterInput('remoteOptions').click();
|
||||
|
||||
ndv.actions.setInvalidExpression('otherField');
|
||||
|
||||
ndv.getters.container().click(); // remove focus from input, hide expression preview
|
||||
|
||||
ndv.getters.parameterInput('remoteOptions').click();
|
||||
getVisibleSelect().find('.el-select-dropdown__item').should('have.length', 3);
|
||||
});
|
||||
|
||||
it('should flag issues as soon as params are set', () => {
|
||||
workflowPage.actions.addInitialNodeToCanvas('Webhook');
|
||||
workflowPage.getters.canvasNodes().first().dblclick();
|
||||
|
||||
Reference in New Issue
Block a user