diff --git a/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx b/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx index 601df5408868..9dc6dc7eef7c 100644 --- a/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx +++ b/packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx @@ -163,6 +163,22 @@ describe(' - Row grouping', () => { expect(getColumnValues(0)).to.deep.equal(['Cat A (3)', '', '', '', 'Cat B (2)', '', '']); }); + it('should display icon on auto-generated row', () => { + render( + ({ ...row, isFilled: false }))} + />, + ); + + expect(screen.getByTestId('CloseIcon')).toBeVisible(); + }); + it('should respect the grouping criteria with colDef.groupable = false', () => { render( { return composeClasses(slots, getDataGridUtilityClass, classes); }; -interface GridBooleanCellProps - extends GridRenderCellParams, - Omit {} +interface GridBooleanCellProps extends GridRenderCellParams, Omit { + hideDescendantCount?: boolean; +} function GridBooleanCellRaw(props: GridBooleanCellProps) { const { @@ -40,6 +40,7 @@ function GridBooleanCellRaw(props: GridBooleanCellProps) { isEditable, hasFocus, tabIndex, + hideDescendantCount, ...other } = props; @@ -108,6 +109,7 @@ GridBooleanCellRaw.propTypes = { * If true, the cell is the active element. */ hasFocus: PropTypes.bool.isRequired, + hideDescendantCount: PropTypes.bool, /** * The grid row id. */ @@ -140,7 +142,7 @@ const GridBooleanCell = React.memo(GridBooleanCellRaw); export { GridBooleanCell }; export const renderBooleanCell: GridColDef['renderCell'] = (params: GridBooleanCellProps) => { - if (isAutoGeneratedRow(params.rowNode)) { + if (params.field !== '__row_group_by_columns_group__' && isAutoGeneratedRow(params.rowNode)) { return ''; }