diff --git a/packages/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
index 5561eb1afc5e5..1b4b0ee4f1041 100644
--- a/packages/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
+++ b/packages/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
@@ -36,7 +36,6 @@ describe(' - Pagination', () => {
act(() => {
apiRef.current.setPage(1);
});
-
expect(getColumnValues(0)).to.deep.equal(['1']);
});
@@ -65,7 +64,6 @@ describe(' - Pagination', () => {
act(() => {
apiRef.current.setPage(50);
});
-
expect(getColumnValues(0)).to.deep.equal(['19']);
});
});
diff --git a/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
index 3fa3aec057ddd..3acb545b4ed5e 100644
--- a/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
+++ b/packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
@@ -719,7 +719,9 @@ describe(' - Rows', () => {
/>,
);
expect(document.querySelectorAll('[role="row"][data-rowindex]')).to.have.length(6);
- act(() => apiRef.current.setPage(1));
+ act(() => {
+ apiRef.current.setPage(1);
+ });
expect(document.querySelectorAll('[role="row"][data-rowindex]')).to.have.length(4);
});
});
diff --git a/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx b/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx
index c2f1e8ec91790..29d754a07069a 100644
--- a/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx
+++ b/packages/x-data-grid/src/tests/rowSpanning.DataGrid.test.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { createRenderer, waitFor, fireEvent, act } from '@mui/internal-test-utils';
+import { createRenderer, fireEvent, act } from '@mui/internal-test-utils';
import { expect } from 'chai';
import { DataGrid, useGridApiRef, DataGridProps, GridApi } from '@mui/x-data-grid';
import { getCell, getActiveCell } from 'test/utils/helperFn';
@@ -224,10 +224,10 @@ describe(' - Row spanning', () => {
/>,
);
expect(Object.keys(apiRef.current.state.rowSpanning.spannedCells).length).to.equal(0);
- apiRef.current.setPage(1);
- await waitFor(() =>
- expect(Object.keys(apiRef.current.state.rowSpanning.spannedCells).length).to.equal(1),
- );
+ await act(() => {
+ apiRef.current.setPage(1);
+ });
+ expect(Object.keys(apiRef.current.state.rowSpanning.spannedCells).length).to.equal(1);
expect(Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length).to.equal(1);
});
});