@@ -382,35 +382,30 @@ describe('IgxGrid - Cell Editing #grid', () => {
382382 } ) ;
383383
384384 it ( 'When cell in editMode and try to navigate with `ArrowUp` - focus should remain over the input.' , ( async ( ) => {
385- setupGridScrollDetection ( fixture , grid ) ;
386- grid . navigateTo ( 8 ) ;
387- await wait ( DEBOUNCETIME ) ;
385+ let cell = grid . getCellByColumn ( 0 , 'firstName' ) ;
386+ UIInteractions . simulateClickAndSelectEvent ( cell ) ;
388387 fixture . detectChanges ( ) ;
389- await wait ( DEBOUNCETIME ) ;
388+ GridFunctions . simulateGridContentKeydown ( fixture , 'ArrowDown' , false , false , true ) ;
389+ await wait ( 100 ) ;
390390 fixture . detectChanges ( ) ;
391391
392- const testCells = grid . getColumnByName ( 'firstName' ) . cells ;
393- let cell = testCells [ testCells . length - 1 ] ;
394- const cellRowIndex = cell . rowIndex ;
395- let cellElem = cell . nativeElement ;
396-
397- UIInteractions . simulateDoubleClickAndSelectEvent ( cellElem ) ;
392+ cell = grid . getCellByColumn ( 8 , 'firstName' ) ;
393+ UIInteractions . simulateDoubleClickAndSelectEvent ( cell ) ;
398394 await wait ( DEBOUNCETIME ) ;
399395 fixture . detectChanges ( ) ;
400396
401397 const inputElem : HTMLInputElement = document . activeElement as HTMLInputElement ;
402398 expect ( cell . editMode ) . toBeTruthy ( ) ;
403- expect ( cellElem . classList . contains ( CELL_CLASS_IN_EDIT_MODE ) ) . toBe ( true ) ;
404- const expectedScroll = grid . verticalScrollContainer . getScroll ( ) . scrollTop ;
399+ expect ( cell . nativeElement . classList . contains ( CELL_CLASS_IN_EDIT_MODE ) ) . toBe ( true ) ;
400+ const expectedScroll = grid . verticalScrollContainer . getScroll ( ) . scrollTop ;
405401
406402 UIInteractions . triggerKeyDownEvtUponElem ( 'ArrowUp' , inputElem , true ) ;
407403 await wait ( DEBOUNCETIME ) ;
408404 fixture . detectChanges ( ) ;
409405
410- cell = grid . getCellByColumn ( cellRowIndex , 'firstName' ) ;
411- cellElem = cell . nativeElement ;
406+ cell = grid . getCellByColumn ( 8 , 'firstName' ) ;
412407 expect ( cell . editMode ) . toBeTruthy ( ) ;
413- expect ( cellElem . classList . contains ( CELL_CLASS_IN_EDIT_MODE ) ) . toBe ( true ) ;
408+ expect ( cell . nativeElement . classList . contains ( CELL_CLASS_IN_EDIT_MODE ) ) . toBe ( true ) ;
414409 expect ( grid . verticalScrollContainer . getScroll ( ) . scrollTop ) . toBe ( expectedScroll ) ;
415410 } ) ) ;
416411
0 commit comments