@@ -566,6 +566,25 @@ describe('IgxGrid - GroupBy #grid', () => {
566566 }
567567 } ) ) ;
568568
569+ it ( 'should not apply grouping if the grouping expressions value is the same reference' , fakeAsync ( ( ) => {
570+ const fix = TestBed . createComponent ( DefaultGridComponent ) ;
571+ fix . detectChanges ( ) ;
572+
573+ // group by string column
574+ const grid = fix . componentInstance . instance ;
575+ fix . detectChanges ( ) ;
576+ grid . groupBy ( {
577+ fieldName : 'ReleaseDate' , dir : SortingDirection . Asc , ignoreCase : false
578+ } ) ;
579+ fix . detectChanges ( ) ;
580+ spyOn ( grid . groupingExpressionsChange , 'emit' ) ;
581+ fix . detectChanges ( ) ;
582+ const firstCell = grid . getCellByColumn ( 2 , 'Downloads' ) ;
583+ UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
584+ fix . detectChanges ( ) ;
585+ expect ( grid . groupingExpressionsChange . emit ) . toHaveBeenCalledTimes ( 0 ) ;
586+ } ) ) ;
587+
569588 // GroupBy + Sorting integration
570589 it ( 'should apply sorting on each group\'s records when non-grouped column is sorted.' , fakeAsync ( ( ) => {
571590 const fix = TestBed . createComponent ( DefaultGridComponent ) ;
@@ -3393,6 +3412,7 @@ describe('IgxGrid - GroupBy #grid', () => {
33933412@Component ( {
33943413 template : `
33953414 <igx-grid
3415+ [(groupingExpressions)]='currentGroupingExpressions'
33963416 [width]='width'
33973417 [height]='height'
33983418 [dropAreaTemplate]='currentDropArea'
@@ -3421,6 +3441,7 @@ export class DefaultGridComponent extends DataParent {
34213441 public enableEditing = false ;
34223442 public enableGrouping = true ;
34233443 public currentSortExpressions ;
3444+ public currentGroupingExpressions = [ ] ;
34243445
34253446 public columnsCreated ( column : IgxColumnComponent ) {
34263447 column . sortable = this . enableSorting ;
0 commit comments