Skip to content

Commit

Permalink
Added cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Oct 31, 2019
1 parent ec4a4b2 commit 65dc87a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client/cypress/integration/query/parameter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,26 @@ describe('Parameter', () => {
cy.percySnapshot('Validation error in query page');
});

it('shows unsaved feedback in query page', function () {
cy.visit(`/queries/${this.query.id}/source`);

cy.getByTestId('QueryEditor')
.get('.ace_text-input')
.type(' {{ newparam }}', { force: true, parseSpecialCharSequences: false });

cy.getByTestId('ParameterName-newparam')
.find('.ant-form-item-control')
.should('have.class', 'has-warning')
.find('.ant-form-explain')
.as('Feedback');

cy.get('@Feedback').should('contain.text', 'Unsaved');
cy.percySnapshot('Unsaved feedback in query page');

cy.getByTestId('SaveButton').click();
cy.get('@Feedback').should('not.exist');
});

it('shows validation error in visualization embed', function () {
cy.visit(`/embed/query/${this.query.id}/visualization/${this.vizId}?api_key=${this.query.api_key}`);
expectValueValidationError();
Expand Down

0 comments on commit 65dc87a

Please sign in to comment.