Skip to content

Commit

Permalink
[test] Speed up slow TablePagination tests (#21374)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Jun 9, 2020
1 parent a34980c commit 51b6ea9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/material-ui/src/TablePagination/TablePagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('<TablePagination />', () => {

describe('prop: page', () => {
it('should disable the back button on the first page', () => {
const { getByRole } = render(
const { getAllByRole } = render(
<table>
<TableFooter>
<TableRow>
Expand All @@ -147,14 +147,14 @@ describe('<TablePagination />', () => {
</TableFooter>
</table>,
);
const backButton = getByRole('button', { name: 'Previous page' });
const nextButton = getByRole('button', { name: 'Next page' });

const [, backButton, nextButton] = getAllByRole('button');
expect(backButton).to.have.property('disabled', true);
expect(nextButton).to.have.property('disabled', false);
});

it('should disable the next button on the last page', () => {
const { getByRole } = render(
const { getAllByRole } = render(
<table>
<TableFooter>
<TableRow>
Expand All @@ -170,8 +170,7 @@ describe('<TablePagination />', () => {
</table>,
);

const backButton = getByRole('button', { name: 'Previous page' });
const nextButton = getByRole('button', { name: 'Next page' });
const [, backButton, nextButton] = getAllByRole('button');
expect(backButton).to.have.property('disabled', false);
expect(nextButton).to.have.property('disabled', true);
});
Expand Down

0 comments on commit 51b6ea9

Please sign in to comment.