@@ -118,7 +118,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
118118 it ( 'should allow navigating up in child grid when child grid selected cell moves outside the parent view port.' , async ( ) => {
119119 hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
120120 fixture . detectChanges ( ) ;
121- await wait ( ) ;
121+ await wait ( DEBOUNCE_TIME ) ;
122122
123123 const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
124124 const childCell = childGrid . dataRowList . toArray ( ) [ 4 ] . cells . first ;
@@ -129,7 +129,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
129129 const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
130130 UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , false ) ;
131131 fixture . detectChanges ( ) ;
132- await wait ( ) ;
132+ await wait ( DEBOUNCE_TIME ) ;
133133 // parent should scroll up so that cell in child is in view.
134134 const currScrTop = hierarchicalGrid . verticalScrollContainer . getScroll ( ) . scrollTop ;
135135 expect ( prevScrTop - currScrTop ) . toBeGreaterThanOrEqual ( childGrid . rowHeight ) ;
@@ -189,7 +189,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
189189
190190 it ( 'should allow navigating to bottom in child grid when child grid target row moves outside the parent view port.' , async ( ) => {
191191 const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
192- const childCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
192+ const childCell = childGrid . dataRowList . first . cells . first ;
193193 GridFunctions . focusCell ( fixture , childCell ) ;
194194
195195 const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
@@ -244,16 +244,16 @@ describe('IgxHierarchicalGrid Navigation', () => {
244244 it ( 'should allow navigating to top in child grid when child grid target row moves outside the parent view port.' , async ( ) => {
245245 hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
246246 fixture . detectChanges ( ) ;
247- await wait ( ) ;
247+ await wait ( DEBOUNCE_TIME ) ;
248248
249249 const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
250250 const childLastRowCell = childGrid . dataRowList . toArray ( ) [ 9 ] . cells . first ;
251+ const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
251252 GridFunctions . focusCell ( fixture , childLastRowCell ) ;
252253
253- const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
254254 UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , true ) ;
255255 fixture . detectChanges ( ) ;
256- await wait ( ) ;
256+ await wait ( DEBOUNCE_TIME ) ;
257257
258258 const childFirstRowCell = childGrid . dataRowList . first . cells . first ;
259259 const selectedCell = fixture . componentInstance . selectedCell ;
@@ -271,20 +271,20 @@ describe('IgxHierarchicalGrid Navigation', () => {
271271 } ) ;
272272
273273 it ( 'should scroll top of child grid into view when pressing Ctrl + Arrow Up when cell is selected in it.' , async ( ) => {
274- hierarchicalGrid . verticalScrollContainer . scrollTo ( 7 ) ;
274+ hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
275275 fixture . detectChanges ( ) ;
276- await wait ( ) ;
276+ await wait ( DEBOUNCE_TIME ) ;
277277
278- const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 3 ] ;
279- const childLastRowCell = childGrid . dataRowList . toArray ( ) [ 9 ] . cells . toArray ( ) [ 0 ] ;
278+ const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
279+ const childLastRowCell = childGrid . dataRowList . toArray ( ) [ 9 ] . cells . first ;
280280 const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
281281 GridFunctions . focusCell ( fixture , childLastRowCell ) ;
282282
283283 UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , true ) ;
284284 fixture . detectChanges ( ) ;
285- await wait ( ) ;
285+ await wait ( DEBOUNCE_TIME ) ;
286286
287- const childFirstRowCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
287+ const childFirstRowCell = childGrid . dataRowList . first . cells . first ;
288288 const selectedCell = fixture . componentInstance . selectedCell ;
289289 expect ( selectedCell . row . index ) . toBe ( childFirstRowCell . row . index ) ;
290290 expect ( selectedCell . column . visibleIndex ) . toBe ( childFirstRowCell . column . visibleIndex ) ;
@@ -296,18 +296,17 @@ describe('IgxHierarchicalGrid Navigation', () => {
296296 const rowElem = childGrid . gridAPI . get_row_by_index ( selectedCell . row . index ) ;
297297 const rowOffsets = rowElem . nativeElement . getBoundingClientRect ( ) ;
298298 expect ( rowOffsets . top ) . toBeGreaterThanOrEqual ( gridOffsets . top ) ;
299- // expect(rowOffsets.bottom).toBeLessThanOrEqual(gridOffsets.bottom);
299+ expect ( rowOffsets . bottom ) . toBeLessThanOrEqual ( gridOffsets . bottom ) ;
300300 } ) ;
301301
302302 it ( 'when navigating down from parent into child should scroll child grid to top and start navigation from first row.' , async ( ) => {
303303 const ri = fixture . componentInstance . rowIsland ;
304304 ri . height = '200px' ;
305305 fixture . detectChanges ( ) ;
306- await wait ( ) ;
307306
308307 const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
309308 childGrid . verticalScrollContainer . scrollTo ( 9 ) ;
310- await wait ( ) ;
309+ await wait ( DEBOUNCE_TIME ) ;
311310 fixture . detectChanges ( ) ;
312311
313312 let currScrTop = childGrid . verticalScrollContainer . getScroll ( ) . scrollTop ;
@@ -317,7 +316,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
317316 GridFunctions . focusCell ( fixture , fCell ) ;
318317
319318 UIInteractions . triggerEventHandlerKeyDown ( 'arrowdown' , baseHGridContent , false , false , false ) ;
320- await wait ( DEBOUNCE_TIME * 3 ) ;
319+ await wait ( DEBOUNCE_TIME ) ;
321320 fixture . detectChanges ( ) ;
322321
323322 const childFirstCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
@@ -368,7 +367,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
368367 it ( 'if next child cell is not in view should scroll parent so that it is in view.' , async ( ) => {
369368 hierarchicalGrid . verticalScrollContainer . scrollTo ( 4 ) ;
370369 fixture . detectChanges ( ) ;
371- await wait ( ) ;
370+ await wait ( DEBOUNCE_TIME ) ;
372371
373372 const parentCell = hierarchicalGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
374373 GridFunctions . focusCell ( fixture , parentCell ) ;
@@ -410,11 +409,11 @@ describe('IgxHierarchicalGrid Navigation', () => {
410409 const lastDataIndex = hierarchicalGrid . dataView . length - 2 ;
411410 hierarchicalGrid . verticalScrollContainer . scrollTo ( lastDataIndex ) ;
412411 fixture . detectChanges ( ) ;
413- await wait ( ) ;
412+ await wait ( DEBOUNCE_TIME ) ;
414413
415414 hierarchicalGrid . verticalScrollContainer . scrollTo ( lastDataIndex ) ;
416415 fixture . detectChanges ( ) ;
417- await wait ( ) ;
416+ await wait ( DEBOUNCE_TIME ) ;
418417
419418 let parentCell = hierarchicalGrid . gridAPI . get_cell_by_index ( 38 , 'ID' ) ;
420419 GridFunctions . focusCell ( fixture , parentCell ) ;
@@ -786,8 +785,8 @@ describe('IgxHierarchicalGrid Navigation', () => {
786785
787786 it ( 'should allow navigating down between sibling child grids.' , async ( ) => {
788787 hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
788+ await wait ( DEBOUNCE_TIME ) ;
789789 fixture . detectChanges ( ) ;
790- await wait ( ) ;
791790
792791 const child1 = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
793792 const child2 = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 5 ] ;
0 commit comments