@@ -2175,6 +2175,28 @@ describe('IgxGrid - GroupBy #grid', () => {
21752175 expect ( fix . componentInstance . onGroupByRowClick ) . toHaveBeenCalledWith ( fix . componentInstance . groupByRowClick , contextUnselect ) ;
21762176 } ) ) ;
21772177
2178+ it ( 'should update chips state when columns are added/removed' , fakeAsync ( ( ) => {
2179+ const fix = TestBed . createComponent ( GroupByDataMoreColumnsComponent ) ;
2180+ const cols = fix . componentInstance . columns ;
2181+ fix . componentInstance . columns = [ ] ;
2182+ fix . componentInstance . instance . groupingExpressions = [
2183+ {
2184+ dir : SortingDirection . Asc ,
2185+ fieldName : 'A' ,
2186+ ignoreCase : false ,
2187+ strategy : DefaultSortingStrategy . instance ( )
2188+ }
2189+ ] ;
2190+ fix . detectChanges ( ) ;
2191+ const chips = fix . componentInstance . instance . groupArea . chips ;
2192+ let chipContent = chips . first . nativeElement . querySelector ( '.igx-chip__content' ) . textContent . trim ( ) ;
2193+ expect ( chipContent ) . toBe ( 'A' ) ;
2194+ fix . componentInstance . columns = cols ;
2195+ fix . detectChanges ( ) ;
2196+ chipContent = chips . first . nativeElement . querySelector ( '.igx-chip__content' ) . textContent . trim ( ) ;
2197+ expect ( chipContent ) . toBe ( 'AA' ) ;
2198+ } ) ) ;
2199+
21782200 // GroupBy Row Formatting
21792201 it ( 'should properly apply formatters, both custom and default ones for the default row value template' , fakeAsync ( ( ) => {
21802202 const fix = TestBed . createComponent ( GroupableGridComponent ) ;
@@ -4103,7 +4125,7 @@ export class CustomTemplateGridComponent extends DataParent {
41034125 [width]='width'
41044126 [height]='height'
41054127 [data]="testData">
4106- <igx-column *ngFor="let c of columns" [groupable]="true" [field]="c.field" [header]="c.field" [width]="c.width + 'px'">
4128+ <igx-column *ngFor="let c of columns" [groupable]="true" [field]="c.field" [header]="c.header || c. field" [width]="c.width + 'px'">
41074129 </igx-column>
41084130 </igx-grid>
41094131 ` ,
@@ -4119,7 +4141,7 @@ export class GroupByDataMoreColumnsComponent extends DataParent {
41194141 public testData = [ ] ;
41204142
41214143 public columns = [
4122- { field : 'A' , width : 100 } ,
4144+ { field : 'A' , header : 'AA' , width : 100 } ,
41234145 { field : 'B' , width : 100 } ,
41244146 { field : 'C' , width : 100 } ,
41254147 { field : 'D' , width : 100 } ,
0 commit comments