@@ -10,6 +10,7 @@ import { IgxHierarchicalRowComponent } from './hierarchical-row.component';
1010import { By } from '@angular/platform-browser' ;
1111import { IgxChildGridRowComponent } from './child-grid-row.component' ;
1212import { DisplayDensity } from '../../core/displayDensity' ;
13+ import { IgxStringFilteringOperand } from '../../data-operations/filtering-condition' ;
1314
1415describe ( 'Basic IgxHierarchicalGrid' , ( ) => {
1516 configureTestSuite ( ) ;
@@ -333,6 +334,24 @@ describe('Basic IgxHierarchicalGrid', () => {
333334 fixture . detectChanges ( ) ;
334335 expect ( childGrid . calcWidth - 170 ) . toBeLessThan ( 3 ) ;
335336 } ) ;
337+
338+ it ( 'child grid width should be recalculated if parent no longer shows scrollbar.' , async ( ) => {
339+ hierarchicalGrid . height = '1000px' ;
340+ fixture . detectChanges ( ) ;
341+ hierarchicalGrid . filter ( 'ProductName' , 'A0' , IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) , true ) ;
342+ fixture . detectChanges ( ) ;
343+ const row = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
344+ UIInteractions . clickElement ( row . expander ) ;
345+ const childGrids = fixture . debugElement . queryAll ( By . css ( 'igx-child-grid-row' ) ) ;
346+ const childGrid = childGrids [ 0 ] . query ( By . css ( 'igx-hierarchical-grid' ) ) . componentInstance ;
347+ expect ( childGrid . calcWidth - 370 - childGrid . scrollWidth ) . toBeLessThanOrEqual ( 5 ) ;
348+
349+ hierarchicalGrid . clearFilter ( ) ;
350+ fixture . detectChanges ( ) ;
351+ await wait ( 30 ) ;
352+
353+ expect ( childGrid . calcWidth - 370 ) . toBeLessThan ( 3 ) ;
354+ } ) ;
336355} ) ;
337356
338357describe ( 'IgxHierarchicalGrid Row Islands' , ( ) => {
0 commit comments