Skip to content

Commit

Permalink
[test] Clean selection tests (#2457)
Browse files Browse the repository at this point in the history
* [core] Clean selection tests
  • Loading branch information
flaviendelangle authored and m4theushw committed Sep 28, 2021
1 parent 0c10dd4 commit 4b557d2
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 562 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export const useGridSelection = (apiRef: GridApiRef, props: GridComponentProps):
hasChanged = true;
}
});

if (hasChanged) {
return { ...state, selection: Object.values(selectionLookup) };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('<DataGrid /> - Pagination', () => {
);
};

describe('prop: page and onPageChange', () => {
describe('props: page and onPageChange', () => {
it('should display the rows of page given in props', () => {
render(<BaselineTestCase page={1} pageSize={1} rowsPerPageOptions={[1]} />);
expect(getColumnValues()).to.deep.equal(['1']);
Expand Down Expand Up @@ -200,7 +200,7 @@ describe('<DataGrid /> - Pagination', () => {
});
});

describe('prop: pageSize and onPageSizeChange', () => {
describe('props: pageSize and onPageSizeChange', () => {
it('should display the amount of rows given in props', () => {
render(<BaselineTestCase page={0} pageSize={2} rowsPerPageOptions={[2]} />);
expect(getColumnValues()).to.deep.equal(['0', '1']);
Expand Down Expand Up @@ -359,7 +359,7 @@ describe('<DataGrid /> - Pagination', () => {
});
});

describe('prop: autoPageSize', () => {
describe('props: autoPageSize', () => {
before(function beforeHook() {
if (isJSDOM) {
// Need layouting
Expand Down
Loading

0 comments on commit 4b557d2

Please sign in to comment.