From 0a2b87f8f829fe2baafa920ae39defcd46df67ad Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 4 May 2023 17:40:03 +0200 Subject: [PATCH] add unit test --- .../rowGrouping.DataGridPremium.test.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/grid/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx b/packages/grid/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx index 7cc9bd991233..19d0cb65230b 100644 --- a/packages/grid/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx +++ b/packages/grid/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx @@ -2654,4 +2654,28 @@ describe(' - Row Grouping', () => { }); await waitFor(() => expect(getCell(1, 3).textContent).to.equal('username 2')); }); + + // See https://github.com/mui/mui-x/issues/8853 + it('should not reorder rows after calling `updateRows`', async () => { + render( + , + ); + + expect(getColumnValues(3)).to.deep.equal(['', 'username1', 'username2']); + + // trigger row update without any changes in row data + act(() => apiRef.current.updateRows([{ id: 1 }])); + + await waitFor(() => { + expect(getColumnValues(3)).to.deep.equal(['', 'username1', 'username2']); + }); + }); });