Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Sep 2, 2019
1 parent 0d43aee commit 574ddd9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/app/visualizations/table/renderer.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@

.ant-table {
flex-grow: 1;

// show and color scrollbars
@media only percy {
overflow-x: scroll;

&::-webkit-scrollbar {
width: 10px;
height: 10px;
}

&::-webkit-scrollbar-track {
background: green;
}

&::-webkit-scrollbar-thumb {
background: red;
}
}
}
}
}
Expand Down
28 changes: 28 additions & 0 deletions client/cypress/integration/dashboard/widget_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,32 @@ describe('Widget', () => {
});
});
});

it('shows horizontal scrollbar for overflowing tabular content', function () {
const queryData = {
query: `select '${'loremipsum'.repeat(15)}' FROM generate_series(1,15)`,
};

const widgetOptions = { position: { col: 0, row: 0, sizeX: 3, sizeY: 10, autoHeight: false } };

createQueryAndAddWidget(this.dashboardId, queryData, widgetOptions).then((elTestId) => {
cy.visit(this.dashboardUrl);
cy.getByTestId(elTestId).should('exist');
cy.percySnapshot('Shows horizontal scrollbar for overflowing tabular content');
});
});

it('shows fixed pagination for overflowing tabular content ', function () {
const queryData = {
query: 'select \'lorem ipsum\' FROM generate_series(1,50)',
};

const widgetOptions = { position: { col: 0, row: 0, sizeX: 3, sizeY: 10, autoHeight: false } };

createQueryAndAddWidget(this.dashboardId, queryData, widgetOptions).then((elTestId) => {
cy.visit(this.dashboardUrl);
cy.getByTestId(elTestId).should('exist');
cy.percySnapshot('Shows fixed pagination for overflowing tabular content');
});
});
});

0 comments on commit 574ddd9

Please sign in to comment.