diff --git a/packages/x-charts/src/internals/animation/useAnimate.test.tsx b/packages/x-charts/src/internals/animation/useAnimate.test.tsx
index 1e3006decd2e3..be5499b2b6edd 100644
--- a/packages/x-charts/src/internals/animation/useAnimate.test.tsx
+++ b/packages/x-charts/src/internals/animation/useAnimate.test.tsx
@@ -1,4 +1,4 @@
-import { createRenderer, screen, waitFor } from '@mui/internal-test-utils';
+import { createRenderer, reactMajor, screen, waitFor } from '@mui/internal-test-utils';
import { expect } from 'chai';
import * as React from 'react';
import { useAnimateInternal } from '@mui/x-charts/internals/animation/useAnimateInternal';
@@ -351,7 +351,7 @@ describe('useAnimate', () => {
await waitTwoFrames();
// Clicking the button is async, so at most one more call could have happened
- expect(calls).to.lessThanOrEqual(numCallsBeforeUnmount + 1);
+ expect(calls).to.lessThanOrEqual(numCallsBeforeUnmount + (reactMajor > 18 ? 1 : 2));
});
it('stops animation when the hook is unmounted', async () => {
diff --git a/packages/x-data-grid-premium/src/tests/dataSourceAggregation.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/dataSourceAggregation.DataGridPremium.test.tsx
index b9b6c306a5eef..e4f4c628b28b5 100644
--- a/packages/x-data-grid-premium/src/tests/dataSourceAggregation.DataGridPremium.test.tsx
+++ b/packages/x-data-grid-premium/src/tests/dataSourceAggregation.DataGridPremium.test.tsx
@@ -99,11 +99,26 @@ describeSkipIf(isJSDOM)(' - Data source aggregation', () => {
}
it('should show aggregation option in the column menu', async () => {
- const { user } = render();
+ const dataSource = {
+ getRows: async () => {
+ fetchRowsSpy();
+ return {
+ rows: [{ id: 123 }],
+ rowCount: 1,
+ aggregateRow: {},
+ };
+ },
+ getAggregatedValue: () => 'Agg value',
+ };
+ const { user } = render(
+ ,
+ );
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.be.greaterThan(0);
});
await user.click(within(getColumnHeaderCell(0)).getByLabelText('id column menu'));
+ // wait for the column menu to be open first
+ await screen.findByRole('menu', { name: 'id column menu' });
await screen.findByLabelText('Aggregation');
});