@@ -118,7 +118,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
118
118
it ( 'should allow navigating up in child grid when child grid selected cell moves outside the parent view port.' , async ( ) => {
119
119
hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
120
120
fixture . detectChanges ( ) ;
121
- await wait ( ) ;
121
+ await wait ( DEBOUNCE_TIME ) ;
122
122
123
123
const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
124
124
const childCell = childGrid . dataRowList . toArray ( ) [ 4 ] . cells . first ;
@@ -129,7 +129,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
129
129
const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
130
130
UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , false ) ;
131
131
fixture . detectChanges ( ) ;
132
- await wait ( ) ;
132
+ await wait ( DEBOUNCE_TIME ) ;
133
133
// parent should scroll up so that cell in child is in view.
134
134
const currScrTop = hierarchicalGrid . verticalScrollContainer . getScroll ( ) . scrollTop ;
135
135
expect ( prevScrTop - currScrTop ) . toBeGreaterThanOrEqual ( childGrid . rowHeight ) ;
@@ -189,7 +189,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
189
189
190
190
it ( 'should allow navigating to bottom in child grid when child grid target row moves outside the parent view port.' , async ( ) => {
191
191
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 ;
193
193
GridFunctions . focusCell ( fixture , childCell ) ;
194
194
195
195
const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
@@ -244,16 +244,16 @@ describe('IgxHierarchicalGrid Navigation', () => {
244
244
it ( 'should allow navigating to top in child grid when child grid target row moves outside the parent view port.' , async ( ) => {
245
245
hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
246
246
fixture . detectChanges ( ) ;
247
- await wait ( ) ;
247
+ await wait ( DEBOUNCE_TIME ) ;
248
248
249
249
const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
250
250
const childLastRowCell = childGrid . dataRowList . toArray ( ) [ 9 ] . cells . first ;
251
+ const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
251
252
GridFunctions . focusCell ( fixture , childLastRowCell ) ;
252
253
253
- const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
254
254
UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , true ) ;
255
255
fixture . detectChanges ( ) ;
256
- await wait ( ) ;
256
+ await wait ( DEBOUNCE_TIME ) ;
257
257
258
258
const childFirstRowCell = childGrid . dataRowList . first . cells . first ;
259
259
const selectedCell = fixture . componentInstance . selectedCell ;
@@ -271,20 +271,20 @@ describe('IgxHierarchicalGrid Navigation', () => {
271
271
} ) ;
272
272
273
273
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 ) ;
275
275
fixture . detectChanges ( ) ;
276
- await wait ( ) ;
276
+ await wait ( DEBOUNCE_TIME ) ;
277
277
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 ;
280
280
const childGridContent = fixture . debugElement . queryAll ( By . css ( GRID_CONTENT_CLASS ) ) [ 1 ] ;
281
281
GridFunctions . focusCell ( fixture , childLastRowCell ) ;
282
282
283
283
UIInteractions . triggerEventHandlerKeyDown ( 'arrowup' , childGridContent , false , false , true ) ;
284
284
fixture . detectChanges ( ) ;
285
- await wait ( ) ;
285
+ await wait ( DEBOUNCE_TIME ) ;
286
286
287
- const childFirstRowCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
287
+ const childFirstRowCell = childGrid . dataRowList . first . cells . first ;
288
288
const selectedCell = fixture . componentInstance . selectedCell ;
289
289
expect ( selectedCell . row . index ) . toBe ( childFirstRowCell . row . index ) ;
290
290
expect ( selectedCell . column . visibleIndex ) . toBe ( childFirstRowCell . column . visibleIndex ) ;
@@ -296,18 +296,17 @@ describe('IgxHierarchicalGrid Navigation', () => {
296
296
const rowElem = childGrid . gridAPI . get_row_by_index ( selectedCell . row . index ) ;
297
297
const rowOffsets = rowElem . nativeElement . getBoundingClientRect ( ) ;
298
298
expect ( rowOffsets . top ) . toBeGreaterThanOrEqual ( gridOffsets . top ) ;
299
- // expect(rowOffsets.bottom).toBeLessThanOrEqual(gridOffsets.bottom);
299
+ expect ( rowOffsets . bottom ) . toBeLessThanOrEqual ( gridOffsets . bottom ) ;
300
300
} ) ;
301
301
302
302
it ( 'when navigating down from parent into child should scroll child grid to top and start navigation from first row.' , async ( ) => {
303
303
const ri = fixture . componentInstance . rowIsland ;
304
304
ri . height = '200px' ;
305
305
fixture . detectChanges ( ) ;
306
- await wait ( ) ;
307
306
308
307
const childGrid = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
309
308
childGrid . verticalScrollContainer . scrollTo ( 9 ) ;
310
- await wait ( ) ;
309
+ await wait ( DEBOUNCE_TIME ) ;
311
310
fixture . detectChanges ( ) ;
312
311
313
312
let currScrTop = childGrid . verticalScrollContainer . getScroll ( ) . scrollTop ;
@@ -317,7 +316,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
317
316
GridFunctions . focusCell ( fixture , fCell ) ;
318
317
319
318
UIInteractions . triggerEventHandlerKeyDown ( 'arrowdown' , baseHGridContent , false , false , false ) ;
320
- await wait ( DEBOUNCE_TIME * 3 ) ;
319
+ await wait ( DEBOUNCE_TIME ) ;
321
320
fixture . detectChanges ( ) ;
322
321
323
322
const childFirstCell = childGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
@@ -368,7 +367,7 @@ describe('IgxHierarchicalGrid Navigation', () => {
368
367
it ( 'if next child cell is not in view should scroll parent so that it is in view.' , async ( ) => {
369
368
hierarchicalGrid . verticalScrollContainer . scrollTo ( 4 ) ;
370
369
fixture . detectChanges ( ) ;
371
- await wait ( ) ;
370
+ await wait ( DEBOUNCE_TIME ) ;
372
371
373
372
const parentCell = hierarchicalGrid . dataRowList . toArray ( ) [ 0 ] . cells . toArray ( ) [ 0 ] ;
374
373
GridFunctions . focusCell ( fixture , parentCell ) ;
@@ -410,11 +409,11 @@ describe('IgxHierarchicalGrid Navigation', () => {
410
409
const lastDataIndex = hierarchicalGrid . dataView . length - 2 ;
411
410
hierarchicalGrid . verticalScrollContainer . scrollTo ( lastDataIndex ) ;
412
411
fixture . detectChanges ( ) ;
413
- await wait ( ) ;
412
+ await wait ( DEBOUNCE_TIME ) ;
414
413
415
414
hierarchicalGrid . verticalScrollContainer . scrollTo ( lastDataIndex ) ;
416
415
fixture . detectChanges ( ) ;
417
- await wait ( ) ;
416
+ await wait ( DEBOUNCE_TIME ) ;
418
417
419
418
let parentCell = hierarchicalGrid . gridAPI . get_cell_by_index ( 38 , 'ID' ) ;
420
419
GridFunctions . focusCell ( fixture , parentCell ) ;
@@ -786,8 +785,8 @@ describe('IgxHierarchicalGrid Navigation', () => {
786
785
787
786
it ( 'should allow navigating down between sibling child grids.' , async ( ) => {
788
787
hierarchicalGrid . verticalScrollContainer . scrollTo ( 2 ) ;
788
+ await wait ( DEBOUNCE_TIME ) ;
789
789
fixture . detectChanges ( ) ;
790
- await wait ( ) ;
791
790
792
791
const child1 = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 0 ] ;
793
792
const child2 = hierarchicalGrid . gridAPI . getChildGrids ( false ) [ 5 ] ;
0 commit comments