diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid.groupby.spec.ts b/projects/igniteui-angular/src/lib/grids/grid/grid.groupby.spec.ts index b160ed748ee..05363b9227b 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid.groupby.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid.groupby.spec.ts @@ -2175,6 +2175,28 @@ describe('IgxGrid - GroupBy #grid', () => { expect(fix.componentInstance.onGroupByRowClick).toHaveBeenCalledWith(fix.componentInstance.groupByRowClick, contextUnselect); })); + it('should update chips state when columns are added/removed', fakeAsync(() => { + const fix = TestBed.createComponent(GroupByDataMoreColumnsComponent); + const cols = fix.componentInstance.columns; + fix.componentInstance.columns = []; + fix.componentInstance.instance.groupingExpressions = [ + { + dir: SortingDirection.Asc, + fieldName: 'A', + ignoreCase: false, + strategy: DefaultSortingStrategy.instance() + } + ]; + fix.detectChanges(); + const chips = fix.componentInstance.instance.groupArea.chips; + let chipContent = chips.first.nativeElement.querySelector('.igx-chip__content').textContent.trim(); + expect(chipContent).toBe('A'); + fix.componentInstance.columns = cols; + fix.detectChanges(); + chipContent = chips.first.nativeElement.querySelector('.igx-chip__content').textContent.trim(); + expect(chipContent).toBe('AA'); + })); + // GroupBy Row Formatting it('should properly apply formatters, both custom and default ones for the default row value template', fakeAsync(() => { const fix = TestBed.createComponent(GroupableGridComponent); @@ -4103,7 +4125,7 @@ export class CustomTemplateGridComponent extends DataParent { [width]='width' [height]='height' [data]="testData"> - + `, @@ -4119,7 +4141,7 @@ export class GroupByDataMoreColumnsComponent extends DataParent { public testData = []; public columns = [ - { field: 'A', width: 100 }, + { field: 'A', header: 'AA', width: 100 }, { field: 'B', width: 100 }, { field: 'C', width: 100 }, { field: 'D', width: 100 }, diff --git a/projects/igniteui-angular/src/lib/grids/grouping/group-by-area.component.html b/projects/igniteui-angular/src/lib/grids/grouping/group-by-area.component.html index 01ddfcc2401..9f2aff0f579 100644 --- a/projects/igniteui-angular/src/lib/grids/grouping/group-by-area.component.html +++ b/projects/igniteui-angular/src/lib/grids/grouping/group-by-area.component.html @@ -2,7 +2,7 @@ - {{ (expression.fieldName | igxGroupByMeta:grid).title }} + {{ (expression.fieldName | igxGroupByMeta:grid:grid.groupablePipeTrigger).title }} {{ expression.dir === 1 ? 'arrow_upward' : 'arrow_downward' }}