Skip to content

Commit

Permalink
🧪 Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Feb 2, 2023
1 parent a22d1be commit f8a6c99
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
10 changes: 7 additions & 3 deletions cypress/e2e/11-inline-expression-editor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ describe('Inline expression editor', () => {

it('should resolve object resolvables', () => {
WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
WorkflowPage.getters.inlineExpressionEditorInput().type('{{} a: 1');
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Object: \{"a":1\}\]$/);
WorkflowPage.getters
.inlineExpressionEditorInput()
.type('{ a: 1 }', { parseSpecialCharSequences: false });
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^\[Object: \{"a": 1\}\]$/);
WorkflowPage.getters.inlineExpressionEditorInput().clear();

WorkflowPage.getters.inlineExpressionEditorInput().type('{{');
WorkflowPage.getters.inlineExpressionEditorInput().type('{{} a: 1 }.a{del}{del}');
WorkflowPage.getters
.inlineExpressionEditorInput()
.type('{ a: 1 }.a', { parseSpecialCharSequences: false });
WorkflowPage.getters.inlineExpressionEditorOutput().contains(/^1$/);
});

Expand Down
30 changes: 13 additions & 17 deletions cypress/e2e/9-expression-editor-modal.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,45 @@ describe('Expression editor modal', () => {
});

it('should resolve primitive resolvables', () => {
WorkflowPage.getters.expressionModalInput().type('{{');
WorkflowPage.getters.expressionModalInput().type('1 + 2');
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.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.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()
.type('{{ { a : 1 }', { parseSpecialCharSequences: false });
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
.expressionModalInput()
.type('{{ { a : 1 }.a', { parseSpecialCharSequences: false });
WorkflowPage.getters.expressionModalOutput().contains(/^1$/);
});

it('should resolve array resolvables', () => {
WorkflowPage.getters.expressionModalInput().type('{{');
WorkflowPage.getters.expressionModalInput().type('[1, 2, 3]');
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.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.expressionModalInput().type('{{ $parameter["operation"]');
WorkflowPage.getters.expressionModalOutput().contains(/^get$/);
});
});

0 comments on commit f8a6c99

Please sign in to comment.