@@ -565,6 +565,25 @@ describe('IgxGrid - GroupBy #grid', () => {
565565 }
566566 } ) ) ;
567567
568+ it ( 'should not apply grouping if the grouping expressions value is the same reference' , fakeAsync ( ( ) => {
569+ const fix = TestBed . createComponent ( DefaultGridComponent ) ;
570+ fix . detectChanges ( ) ;
571+
572+ // group by string column
573+ const grid = fix . componentInstance . instance ;
574+ fix . detectChanges ( ) ;
575+ grid . groupBy ( {
576+ fieldName : 'ReleaseDate' , dir : SortingDirection . Asc , ignoreCase : false
577+ } ) ;
578+ fix . detectChanges ( ) ;
579+ spyOn ( grid . groupingExpressionsChange , 'emit' ) ;
580+ fix . detectChanges ( ) ;
581+ const firstCell = grid . getCellByColumn ( 2 , 'Downloads' ) ;
582+ UIInteractions . simulateClickAndSelectEvent ( firstCell ) ;
583+ fix . detectChanges ( ) ;
584+ expect ( grid . groupingExpressionsChange . emit ) . toHaveBeenCalledTimes ( 0 ) ;
585+ } ) ) ;
586+
568587 // GroupBy + Sorting integration
569588 it ( 'should apply sorting on each group\'s records when non-grouped column is sorted.' , fakeAsync ( ( ) => {
570589 const fix = TestBed . createComponent ( DefaultGridComponent ) ;
@@ -2620,6 +2639,7 @@ describe('IgxGrid - GroupBy #grid', () => {
26202639@Component ( {
26212640 template : `
26222641 <igx-grid
2642+ [(groupingExpressions)]='currentGroupingExpressions'
26232643 [width]='width'
26242644 [height]='height'
26252645 [dropAreaTemplate]='currentDropArea'
@@ -2648,6 +2668,7 @@ export class DefaultGridComponent extends DataParent {
26482668 public enableEditing = false ;
26492669 public enableGrouping = true ;
26502670 public currentSortExpressions ;
2671+ public currentGroupingExpressions = [ ] ;
26512672
26522673 public columnsCreated ( column : IgxColumnComponent ) {
26532674 column . sortable = this . enableSorting ;
0 commit comments