mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 13:39:44 -08:00
a89c9c68d1
* test: add tests for pinning * test: add test for value * test: add pinned data tests * test: refactor into ndv * refactor: move to ndv * refactor: rename node * test: fix test * test: fix refactor * test: remove unused id * test: update test * test: chain rename input * test: refactor invoking text * test: fix ndv tests * test: move test id * test: update selectors
66 lines
2.5 KiB
TypeScript
66 lines
2.5 KiB
TypeScript
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
|
|
|
const WorkflowPage = new WorkflowPageClass();
|
|
|
|
describe('Expression editor modal', () => {
|
|
before(() => {
|
|
cy.resetAll();
|
|
cy.skipSetup();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
WorkflowPage.actions.visit();
|
|
WorkflowPage.actions.addInitialNodeToCanvas('Manual Trigger');
|
|
WorkflowPage.actions.addNodeToCanvas('Hacker News');
|
|
WorkflowPage.actions.openNode('Hacker News');
|
|
WorkflowPage.actions.openExpressionEditorModal();
|
|
});
|
|
|
|
it('should resolve primitive resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('1 + 2');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^3$/);
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('"ab" + "cd"');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^abcd$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('true && false');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^false$/);
|
|
});
|
|
|
|
it('should resolve object resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('{{} a: 1');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^\[Object: \{"a":1\}\]$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('{{} a: 1 }.a{del}{del}');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^1$/);
|
|
});
|
|
|
|
it('should resolve array resolvables', () => {
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('[1, 2, 3]');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^\[Array: \[1,2,3\]\]$/);
|
|
|
|
WorkflowPage.getters.expressionModalInput().clear();
|
|
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('[1, 2, 3][0]');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^1$/);
|
|
});
|
|
|
|
it('should resolve $parameter[]', () => {
|
|
WorkflowPage.getters.expressionModalInput().type('{{');
|
|
WorkflowPage.getters.expressionModalInput().type('$parameter["operation"]');
|
|
WorkflowPage.getters.expressionModalOutput().contains(/^get$/);
|
|
});
|
|
});
|