@@ -4,7 +4,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
44import { IgxHierarchicalGridModule } from './public_api' ;
55import { Component , ViewChild , DebugElement } from '@angular/core' ;
66import { IgxHierarchicalGridComponent } from './hierarchical-grid.component' ;
7- import { wait , UIInteractions } from '../../test-utils/ui-interactions.spec' ;
7+ import { wait , UIInteractions , waitForSelectionChange , waitForGridScroll } from '../../test-utils/ui-interactions.spec' ;
88import { IgxRowIslandComponent } from './row-island.component' ;
99import { By } from '@angular/platform-browser' ;
1010import { IgxHierarchicalRowComponent } from './hierarchical-row.component' ;
@@ -193,7 +193,8 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
193193 const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
194194 UIInteractions . triggerEventHandlerKeyDown ( 'arrowdown' , childGridContent , false , false , true ) ;
195195 fixture . detectChanges ( ) ;
196- await wait ( 1000 ) ;
196+ // wait for parent grid to complete scroll to child cell.
197+ await waitForGridScroll ( hierarchicalGrid ) ;
197198 fixture . detectChanges ( ) ;
198199
199200 const selectedCell = fixture . componentInstance . selectedCell ;
@@ -368,7 +369,7 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
368369
369370 UIInteractions . triggerEventHandlerKeyDown ( 'end' , baseHGridContent , false , false , true ) ;
370371 fixture . detectChanges ( ) ;
371- await wait ( 1000 ) ;
372+ await waitForSelectionChange ( hierarchicalGrid ) ;
372373 fixture . detectChanges ( ) ;
373374
374375 const lastDataCell = hierarchicalGrid . getCellByKey ( 19 , 'childData2' ) ;
0 commit comments