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