File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
projects/igniteui-angular/src/lib/grids/hierarchical-grid Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -668,6 +668,18 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
668668 ) ;
669669 jasmine . getEnv ( ) . allowRespy ( false ) ;
670670 } ) ;
671+
672+ it ( 'should calculate correct column headers width when rowSelection + expand indicators' , ( ) => {
673+ hierarchicalGrid . rowSelection = 'multiple' ;
674+ fixture . detectChanges ( ) ;
675+
676+ const headerRowElement = hierarchicalGrid . nativeElement . querySelector ( "igx-grid-header-row" ) ;
677+ const headerRowDiv = headerRowElement . querySelector ( ".igx-grid__tr" ) ;
678+ const headerRowChildren = Array . from ( headerRowDiv . children ) ;
679+
680+ const elementsWidth = headerRowChildren . reduce ( ( acc , el ) => acc + ( el as HTMLElement ) . offsetWidth , 0 ) ;
681+ expect ( elementsWidth ) . toEqual ( ( headerRowDiv as HTMLElement ) . offsetWidth ) ;
682+ } ) ;
671683 } ) ;
672684
673685 describe ( 'IgxHierarchicalGrid Row Islands #hGrid' , ( ) => {
@@ -1690,7 +1702,7 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
16901702 UIInteractions . simulateClickAndSelectEvent ( row . expander ) ;
16911703 fixture . detectChanges ( ) ;
16921704
1693- let childGrid = hierarchicalGrid . gridAPI . getChildGrids ( ) [ 0 ] ;
1705+ const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( ) [ 0 ] ;
16941706 const childRow = childGrid . gridAPI . get_row_by_index ( 0 ) as IgxHierarchicalRowComponent ;
16951707 UIInteractions . simulateClickAndSelectEvent ( childRow . expander ) ;
16961708 fixture . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments