mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
675ec21d33
- Split Items List node into separate nodes per action - Review node descriptions - New icons - New sections in subcategories --------- Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: Deborah <deborah@starfallprojects.co.uk> Co-authored-by: Michael Kret <michael.k@radency.com>
63 lines
2.3 KiB
TypeScript
63 lines
2.3 KiB
TypeScript
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
|
|
|
const WorkflowPage = new WorkflowPageClass();
|
|
|
|
describe('Expression editor modal', () => {
|
|
beforeEach(() => {
|
|
WorkflowPage.actions.visit();
|
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual');
|
|
WorkflowPage.actions.addNodeToCanvas('Hacker News');
|
|
WorkflowPage.actions.openNode('Hacker News');
|
|
WorkflowPage.actions.openExpressionEditorModal();
|
|
|
|
cy.on('uncaught:exception', (err) => err.name !== 'ExpressionError');
|
|
});
|
|
|
|
it('should resolve primitive resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
WorkflowPage.getters.expressionModalInput().type('{{ 1 + 2');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^3$/);
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{ "ab" + "cd"');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^abcd$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{ true && false');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^false$/);
|
|
});
|
|
|
|
it('should resolve object resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
WorkflowPage.getters
|
|
.expressionModalInput()
|
|
.type('{{ { a : 1 }', { parseSpecialCharSequences: false });
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^\[Object: \{"a": 1\}\]$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters
|
|
.expressionModalInput()
|
|
.type('{{ { a : 1 }.a', { parseSpecialCharSequences: false });
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^1$/);
|
|
});
|
|
|
|
it('should resolve array resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
WorkflowPage.getters.expressionModalInput().type('{{ [1, 2, 3]');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^\[Array: \[1,2,3\]\]$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{ [1, 2, 3][0]');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^1$/);
|
|
});
|
|
|
|
it('should resolve $parameter[]', () => {
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
WorkflowPage.getters.expressionModalInput().type('{{ $parameter["operation"]');
|
|
WorkflowPage.getters.expressionModalOutput().should('have.text', 'getAll');
|
|
});
|
|
});
|