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 f4102a32079f2..c96c589ce3ad2 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
@@ -157,7 +157,7 @@ describe(' - Data source aggregation', () => {
expect(footerRow?.id).to.deep.equal({ position: 'footer', value: 10 });
});
- it('should derive the aggregation values using `dataSource.getAggregatedValue`', () => {
+ it('should derive the aggregation values using `dataSource.getAggregatedValue`', async () => {
const getAggregatedValue = () => 'Agg value';
render(
- Data source aggregation', () => {
getAggregatedValue={getAggregatedValue}
/>,
);
- expect(Object.keys(apiRef.current!.state.aggregation.lookup).length).to.be.greaterThan(0);
+ await waitFor(() => {
+ expect(Object.keys(apiRef.current!.state.aggregation.lookup).length).to.be.greaterThan(0);
+ });
expect(apiRef.current?.state.aggregation.lookup[GRID_ROOT_GROUP_ID].id.value).to.equal(
'Agg value',
);