Skip to content

Commit

Permalink
Added cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Oct 31, 2019
1 parent b0b1a83 commit ad619b8
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion client/cypress/integration/query/parameter_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createQuery } from '../../support/redash-api';
import { createQuery, createDashboard, addWidget } from '../../support/redash-api';

const { get } = Cypress._;

Expand Down Expand Up @@ -612,6 +612,25 @@ describe('Parameter', () => {
expectValueValidationError();
cy.percySnapshot('Validation error in query page');
});

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();
cy.percySnapshot('Validation error in visualization embed');
});

it('shows validation error in dashboard widget', function () {
createDashboard('Foo')
.then(({ slug, id }) => {
this.dashboardUrl = `/dashboard/${slug}`;
return addWidget(id, this.vizId);
})
.then(() => {
cy.visit(this.dashboardUrl);
});
expectValueValidationError();
cy.percySnapshot('Validation error in dashboard widget');
});
});

describe('Apply Changes', () => {
Expand Down

0 comments on commit ad619b8

Please sign in to comment.