Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arminmeh committed Feb 13, 2025
1 parent 6d0252c commit bbbba77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describeSkipIf(isJSDOM)('<DataGridPro /> - Data source lazy loader', () => {
});
});

it('should keep the scroll position when sorting is applied', async () => {
it('should reset the scroll position when sorting is applied', async () => {
render(<TestDataSourceLazyLoader />);
// wait until the rows are rendered
await waitFor(() => expect(getRow(0)).not.to.be.undefined);
Expand Down Expand Up @@ -169,7 +169,7 @@ describeSkipIf(isJSDOM)('<DataGridPro /> - Data source lazy loader', () => {
});

const afterSortSearchParams = new URL(fetchRowsSpy.lastCall.args[0]).searchParams;
expect(afterSortSearchParams.get('end')).to.equal(beforeSortSearchParams.get('end'));
expect(afterSortSearchParams.get('end')).to.equal('9');
});

it('should reset the scroll position when filter is applied', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ describe('<DataGridPro /> - State persistence', () => {
it('should export the current version of the exportable state', () => {
render(<TestCase />);
act(() => {
apiRef.current?.setPaginationModel({ page: 1, pageSize: 2 });
apiRef.current?.setPinnedColumns({ left: ['id'] });
apiRef.current?.showPreferences(GridPreferencePanelsValue.filters);
apiRef.current?.setSortModel([{ field: 'id', sort: 'desc' }]);
apiRef.current?.setFilterModel({
items: [{ field: 'id', operator: '>=', value: '0' }],
});
apiRef.current?.setPaginationModel({ page: 1, pageSize: 2 });
apiRef.current?.setColumnIndex('category', 1);
apiRef.current?.setColumnWidth('category', 75);
apiRef.current?.setColumnVisibilityModel({ idBis: false });
Expand Down

0 comments on commit bbbba77

Please sign in to comment.