From 695e46e00e07738da62f0356a9f3f839525b1bce Mon Sep 17 00:00:00 2001 From: Armin Mehinovic Date: Fri, 10 Jan 2025 12:30:13 +0100 Subject: [PATCH] Wait for the data to load --- .../src/tests/dataSourceAggregation.DataGridPremium.test.tsx | 3 +++ 1 file changed, 3 insertions(+) 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 f5cd1c40ee08d..e50d54a5fecc1 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 @@ -98,6 +98,9 @@ describe(' - Data source aggregation', () => { it('should show aggregation option in the column menu', async () => { const { user } = render(); + await waitFor(() => { + expect(getRowsSpy.callCount).to.be.greaterThan(0); + }); await user.click(within(getColumnHeaderCell(0)).getByLabelText('Menu')); expect(screen.queryByLabelText('Aggregation')).not.to.equal(null); });