Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kravets-levko committed Oct 17, 2019
1 parent 1cd4441 commit 41cba71
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/app/pages/queries/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ <h3>
<a ng-show="!sourceMode" ng-href="{{query.getUrl(true, selectedTab)}}" class="btn btn-default btn--showhide">
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit Source</i>
</a>
<a ng-show="sourceMode" ng-href="{{query.getUrl(false, selectedTab)}}" class="btn btn-default btn--showhide">
<a
ng-show="sourceMode"
ng-href="{{query.getUrl(false, selectedTab)}}"
class="btn btn-default btn--showhide"
data-test="QueryPageShowDataOnly"
>
<i class="fa fa-table" aria-hidden="true"></i> Show Data Only</i>
</a>
</span>
Expand Down
14 changes: 14 additions & 0 deletions client/cypress/integration/visualizations/sankey_sunburst_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const SQL = `
`;

describe('Sankey and Sunburst', () => {
const viewportWidth = Cypress.config('viewportWidth');

beforeEach(() => {
cy.login();
createQuery({ query: SQL }).then(({ id }) => {
Expand All @@ -35,6 +37,12 @@ describe('Sankey and Sunburst', () => {
cy.getByTestId('VisualizationPreview').find('svg').should('exist');
cy.getByTestId('EditVisualizationDialog').contains('button', 'Save').click();
cy.getByTestId('QueryPageVisualizationTabs').contains('li', visualizationName).should('exist');

cy.getByTestId('QueryPageShowDataOnly').click();

// wait a bit before taking snapshot
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.percySnapshot('Visualizations - Sunburst', { widths: [viewportWidth] });
});

it('creates Sankey', () => {
Expand All @@ -47,5 +55,11 @@ describe('Sankey and Sunburst', () => {
cy.getByTestId('VisualizationPreview').find('svg').should('exist');
cy.getByTestId('EditVisualizationDialog').contains('button', 'Save').click();
cy.getByTestId('QueryPageVisualizationTabs').contains('li', visualizationName).should('exist');

cy.getByTestId('QueryPageShowDataOnly').click();

// wait a bit before taking snapshot
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.percySnapshot('Visualizations - Sankey', { widths: [viewportWidth] });
});
});

0 comments on commit 41cba71

Please sign in to comment.