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 63f7c44bee3f0..afa950f264709 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,13 +99,17 @@ describe(' - Data source aggregation', () => { it('should show aggregation option in the column menu', async () => { const { user } = render(); await user.click(within(getColumnHeaderCell(0)).getByLabelText('Menu')); - expect(screen.queryByLabelText('Aggregation')).not.to.equal(null); + await waitFor(() => { + expect(screen.getByLabelText('Aggregation')).not.to.equal(null); + }); }); it('should not show aggregation option in the column menu when no aggregation function is defined', async () => { const { user } = render(); await user.click(within(getColumnHeaderCell(0)).getByLabelText('Menu')); - expect(screen.queryByLabelText('Aggregation')).to.equal(null); + await waitFor(() => { + expect(screen.getByLabelText('Aggregation')).to.equal(null); + }); }); it('should provide the `aggregationModel` in the `getRows` params', async () => {