@@ -23,7 +23,6 @@ import { Size } from '../common/enums';
2323import { setElementSize } from '../../test-utils/helper-utils.spec' ;
2424import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
2525import { IgxPivotRowDimensionContentComponent } from './pivot-row-dimension-content.component' ;
26- import { flatten } from '../../core/utils' ;
2726
2827const CSS_CLASS_LIST = 'igx-drop-down__list' ;
2928const CSS_CLASS_ITEM = 'igx-drop-down__item' ;
@@ -3107,7 +3106,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
31073106 ] ;
31083107 pivotGrid . pipeTrigger ++ ;
31093108 fixture . detectChanges ( ) ;
3110- const rowHeaders = fixture . debugElement . queryAll (
3109+ let rowHeaders = fixture . debugElement . queryAll (
31113110 By . directive ( IgxPivotRowDimensionHeaderComponent ) ) ;
31123111
31133112 const productsHeaderColumn = rowHeaders . filter ( x => x . componentInstance . column . header === "ProductCategory" ) [ 0 ] . nativeElement ;
@@ -3119,8 +3118,14 @@ describe('IgxPivotGrid #pivotGrid', () => {
31193118 const sortIcon = productsHeaderColumn . querySelectorAll ( 'igx-icon' ) [ 0 ] ;
31203119 sortIcon . click ( ) ;
31213120 fixture . detectChanges ( ) ;
3121+ sortIcon . click ( ) ;
3122+ fixture . detectChanges ( ) ;
31223123
3123- expect ( productRowContentsHeaders ) . toEqual ( [ 'ProductCategory' , 'Components' , 'Clothing' , 'Bikes' , 'Accessories' ] ) ;
3124+ rowHeaders = fixture . debugElement . queryAll (
3125+ By . directive ( IgxPivotRowDimensionHeaderComponent ) ) ;
3126+ const updatedProductRowContents = rowHeaders . filter ( x => x . componentInstance . column . field === "ProductCategory" ) ;
3127+ const updatedProductRowContentsHeaders = updatedProductRowContents . map ( x => x . componentInstance . column . header ) ;
3128+ expect ( updatedProductRowContentsHeaders ) . toEqual ( [ 'ProductCategory' , 'Components' , 'Clothing' , 'Bikes' , 'Accessories' ] ) ;
31243129 } ) ;
31253130
31263131 it ( "should allow select/deselect the correct rows on row header click." , ( ) => {
0 commit comments