Skip to content

Commit 57125e2

Browse files
committed
chore(*): update failing tests
1 parent af84f0c commit 57125e2

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-cell-editing.spec.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class GridFunctions {
244244
}
245245

246246
public static getGroupedRows(fix): DebugElement[] {
247-
return fix.debugElement.queryAll(By.css(GROUP_ROW_CLASS));
247+
return this.sortDebugElementsVertically(fix.debugElement.queryAll(By.css(GROUP_ROW_CLASS)));
248248
}
249249

250250
public static verifyGroupRowIsFocused(groupRow, focused = true) {

0 commit comments

Comments
 (0)