@@ -942,6 +942,35 @@ describe('IgxHierarchicalGrid Integration', () => {
942942 expect ( childGrid . columnList . toArray ( ) [ 0 ] . pinned ) . toBeTruthy ( ) ;
943943 expect ( headers [ 0 ] . classList . contains ( 'igx-grid__th--pinned' ) ) . toBeTruthy ( ) ;
944944 } ) ) ;
945+
946+ it ( 'should be applied correctly for child grid with multi-column header.' , ( ( ) => {
947+ const ri = fixture . componentInstance . rowIsland ;
948+ const col = ri . columnList . find ( x => x . header === 'Information' ) ;
949+ col . pinned = true ;
950+ fixture . detectChanges ( ) ;
951+
952+ const row = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
953+ UIInteractions . clickElement ( row . expander ) ;
954+ fixture . detectChanges ( ) ;
955+
956+ const childGrids = fixture . debugElement . queryAll ( By . css ( 'igx-child-grid-row' ) ) ;
957+ const childGrid = childGrids [ 0 ] . query ( By . css ( 'igx-hierarchical-grid' ) ) . componentInstance ;
958+ // check unpinned/pinned columns
959+ expect ( childGrid . pinnedColumns . length ) . toBe ( 3 ) ;
960+ expect ( childGrid . unpinnedColumns . length ) . toBe ( 1 ) ;
961+ // check cells
962+ const cells = childGrid . getRowByIndex ( 0 ) . cells ;
963+ expect ( cells . length ) . toBe ( 3 ) ;
964+ let cell = childGrid . getCellByColumn ( 0 , 'ChildLevels' ) ;
965+ expect ( cell . visibleColumnIndex ) . toEqual ( 0 ) ;
966+ expect ( cell . nativeElement . classList . contains ( 'igx-grid__td--pinned' ) ) . toBe ( true ) ;
967+ cell = childGrid . getCellByColumn ( 0 , 'ProductName' ) ;
968+ expect ( cell . visibleColumnIndex ) . toEqual ( 1 ) ;
969+ expect ( cell . nativeElement . classList . contains ( 'igx-grid__td--pinned' ) ) . toBe ( true ) ;
970+ cell = childGrid . getCellByColumn ( 0 , 'ID' ) ;
971+ expect ( cell . visibleColumnIndex ) . toEqual ( 2 ) ;
972+ expect ( cell . nativeElement . classList . contains ( 'igx-grid__td--pinned' ) ) . toBe ( false ) ;
973+ } ) ) ;
945974 } ) ;
946975} ) ;
947976
0 commit comments