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