Skip to content

Commit d16f4ff

Browse files
committed
chore(*): update failing tests
1 parent c29dc15 commit d16f4ff

File tree

8 files changed

+25
-24
lines changed

8 files changed

+25
-24
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ describe('IgxGrid - Cell Editing #grid', () => {
388388
await wait(500);
389389
fixture.detectChanges();
390390

391-
const testCells = grid.getColumnByName('firstName').cells;
392-
const cell = testCells[testCells.length - 1];
391+
let testCells = grid.getColumnByName('firstName').cells;
392+
let cell = testCells[testCells.length - 1];
393393
cellElem = cell.nativeElement;
394394

395395
cellElem.dispatchEvent(new Event('focus'));
@@ -407,6 +407,9 @@ describe('IgxGrid - Cell Editing #grid', () => {
407407
await wait(DEBOUNCETIME);
408408

409409
inputElem = document.activeElement as HTMLInputElement;
410+
testCells = grid.getColumnByName('firstName').cells;
411+
cell = testCells[testCells.length - 1];
412+
cellElem = cell.nativeElement;
410413
expect(cell.editMode).toBeTruthy();
411414
expect(cellElem.classList.contains(CELL_CLASS_IN_EDIT_MODE)).toBe(true);
412415
expect(verticalScroll.scrollTop).toBe(expectedScroll);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ describe('IgxGrid - Cell selection #grid', () => {
13731373
GridSelectionFunctions.verifyCellSelected(cell);
13741374
expect(grid.selectedCells.length).toBe(1);
13751375

1376-
const row = grid.getRowByIndex(3);
1376+
let row = grid.getRowByIndex(3);
13771377
expect(row instanceof IgxGridGroupByRowComponent).toBe(true);
13781378
expect(row.focused).toBe(true);
13791379

@@ -1399,6 +1399,7 @@ describe('IgxGrid - Cell selection #grid', () => {
13991399
await wait(100);
14001400
fix.detectChanges();
14011401

1402+
row = grid.getRowByIndex(3);
14021403
expect(selectionChangeSpy).toHaveBeenCalledTimes(2);
14031404
expect(grid.selectedCells.length).toBe(4);
14041405
expect(row instanceof IgxGridGroupByRowComponent).toBe(true);

projects/igniteui-angular/src/lib/grids/grid/grid.master-detail.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe('IgxGrid Master Detail #grid', () => {
374374
});
375375

376376
it('Should navigate down through a detail view partially out of view by scrolling it so it becomes fully visible.', async() => {
377-
const row = grid.getRowByIndex(4) as IgxGridRowComponent;
377+
let row = grid.getRowByIndex(4) as IgxGridRowComponent;
378378
const targetCellElement = grid.getCellByColumn(4, 'ContactName');
379379
UIInteractions.simulateClickAndSelectEvent(targetCellElement);
380380
fix.detectChanges();
@@ -383,6 +383,7 @@ describe('IgxGrid Master Detail #grid', () => {
383383
await wait(DEBOUNCETIME);
384384
fix.detectChanges();
385385

386+
row = grid.getRowByIndex(4) as IgxGridRowComponent;
386387
const detailRow = GridFunctions.getMasterRowDetail(row);
387388
GridFunctions.verifyMasterDetailRowFocused(detailRow);
388389
expect(GridFunctions.elementInGridView(grid, detailRow)).toBeTruthy();
@@ -395,7 +396,7 @@ describe('IgxGrid Master Detail #grid', () => {
395396
await wait(DEBOUNCETIME);
396397
fix.detectChanges();
397398

398-
const row = grid.getRowByIndex(6) as IgxGridRowComponent;
399+
let row = grid.getRowByIndex(6) as IgxGridRowComponent;
399400
const targetCellElement = grid.getCellByColumn(6, 'ContactName');
400401
UIInteractions.simulateClickAndSelectEvent(targetCellElement);
401402
fix.detectChanges();
@@ -407,6 +408,7 @@ describe('IgxGrid Master Detail #grid', () => {
407408
await wait(DEBOUNCETIME);
408409
fix.detectChanges();
409410

411+
row = grid.getRowByIndex(6) as IgxGridRowComponent;
410412
const detailRow = GridFunctions.getMasterRowDetail(row);
411413
GridFunctions.verifyMasterDetailRowFocused(detailRow);
412414
expect(GridFunctions.elementInGridView(grid, detailRow)).toBeTruthy();
@@ -455,15 +457,16 @@ describe('IgxGrid Master Detail #grid', () => {
455457
await wait(DEBOUNCETIME);
456458
fix.detectChanges();
457459

458-
const row = grid.getRowByIndex(2);
460+
let row = grid.getRowByIndex(2);
459461
const targetCellElement = grid.getCellByColumn(2, 'ContactName');
460462
UIInteractions.simulateClickAndSelectEvent(targetCellElement);
461463
fix.detectChanges();
462464

463465
UIInteractions.triggerEventHandlerKeyDown('ArrowUp', gridContent);
464-
fix.detectChanges();
465466
await wait(DEBOUNCETIME);
467+
fix.detectChanges();
466468

469+
row = grid.getRowByIndex(2);
467470
const detailRow = row.element.nativeElement.previousElementSibling as HTMLElement;
468471
GridFunctions.verifyMasterDetailRowFocused(detailRow);
469472
expect(GridFunctions.elementInGridView(grid, detailRow)).toBeTruthy();

projects/igniteui-angular/src/lib/grids/grid/grid.multi-row-layout.integration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ describe('IgxGrid - multi-row-layout Integration #grid - ', () => {
606606
await wait(100);
607607
fixture.detectChanges();
608608

609-
const lastCell = grid.rowList.first.cells.toArray()[6];
609+
const lastCell = grid.rowList.first.cells.toArray()[5];
610610
expect(lastCell.column.field).toBe('Address');
611611
expect(lastCell.column.parent.field).toBe('group4');
612612
expect(Math.round(lastCell.nativeElement.getBoundingClientRect().right) -

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.navigation.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
620620
await wait(DEBOUNCE_TIME);
621621
fixture.detectChanges();
622622

623-
UIInteractions.triggerKeyDownEvtUponElem('tab', cell.nativeElement, true, false, true);
623+
UIInteractions.triggerEventHandlerKeyDown('tab', baseHGridContent, false, true, false);
624624
await wait(DEBOUNCE_TIME);
625625
fixture.detectChanges();
626626
const activeEl = document.activeElement;

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ it('should update scroll height after expanding/collapsing row in a nested child
334334
expect(childRowComponent.index).toBe(4);
335335

336336
hierarchicalGrid.verticalScrollContainer.scrollNext();
337-
await wait(100);
337+
await wait(200);
338338
fixture.detectChanges();
339339
childRowComponent = fixture.debugElement.query(By.css('igx-child-grid-row')).componentInstance;
340340
expect(childRowComponent.rowData.rowID).toBe('3');

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-keyBoardNav.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ describe('IgxTreeGrid - Key Board Navigation #tGrid', () => {
421421
UIInteractions.triggerEventHandlerKeyDown('ArrowDown', gridContent);
422422
await wait(DEBOUNCETIME);
423423
fix.detectChanges();
424+
cell = treeGrid.getCellByColumn(i, 'ID');
424425
TreeGridFunctions.verifyTreeGridCellSelected(treeGrid, cell, false);
425426
cell = treeGrid.getCellByColumn(i + 1, 'ID');
426427
TreeGridFunctions.verifyTreeGridCellSelected(treeGrid, cell);
@@ -431,6 +432,7 @@ describe('IgxTreeGrid - Key Board Navigation #tGrid', () => {
431432
UIInteractions.triggerEventHandlerKeyDown('ArrowUp', gridContent);
432433
await wait(DEBOUNCETIME);
433434
fix.detectChanges();
435+
cell = treeGrid.getCellByColumn(i, 'ID');
434436
TreeGridFunctions.verifyTreeGridCellSelected(treeGrid, cell, false);
435437
cell = treeGrid.getCellByColumn(i - 1, 'ID');
436438
TreeGridFunctions.verifyTreeGridCellSelected(treeGrid, cell);

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-multi-cell-selection.spec.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -371,19 +371,15 @@ describe('IgxTreeGrid - Multi Cell selection #tGrid', () => {
371371
treeGrid.summaryCalculationMode = 'childLevelsOnly';
372372
fix.detectChanges();
373373

374+
const gridContent = GridFunctions.getGridContent(fix);
374375
const cell = treeGrid.getCellByColumn(8, 'Name');
375376
UIInteractions.simulateClickAndSelectEvent(cell);
376377
fix.detectChanges();
377378

378379
GridSelectionFunctions.verifyCellSelected(cell);
379380

380381
for (let i = 8; i < 16; i++) {
381-
let cellObj = treeGrid.getCellByColumn(i, 'Name');
382-
if (!cellObj) {
383-
cellObj = treeGrid.summariesRowList.find(row => row.index === i)
384-
.summaryCells.find(sCell => sCell.visibleColumnIndex === 1);
385-
}
386-
UIInteractions.triggerKeyDownEvtUponElem('arrowdown', cellObj.nativeElement, true, false, true);
382+
UIInteractions.triggerEventHandlerKeyDown('arrowdown', gridContent, false, true);
387383
await wait(30);
388384
fix.detectChanges();
389385
}
@@ -392,18 +388,14 @@ describe('IgxTreeGrid - Multi Cell selection #tGrid', () => {
392388
GridSelectionFunctions.verifyCellsRegionSelected(treeGrid, 8, 15, 1, 1);
393389

394390
for (let i = 1; i < 3; i++) {
395-
const cellObject = treeGrid.summariesRowList.find(row => row.index === 16)
396-
.summaryCells.find(sCell => sCell.visibleColumnIndex === i);
397-
UIInteractions.triggerKeyDownEvtUponElem('arrowright', cellObject.nativeElement, true, false, true);
391+
UIInteractions.triggerEventHandlerKeyDown('arrowright', gridContent, false, true);
398392
await wait(30);
399393
fix.detectChanges();
400394
}
401395

402396
GridSelectionFunctions.verifyCellsRegionSelected(treeGrid, 8, 15, 1, 1);
403397

404-
const summaryCell = treeGrid.summariesRowList.find(row => row.index === 16)
405-
.summaryCells.find(sCell => sCell.visibleColumnIndex === 3);
406-
UIInteractions.triggerKeyDownEvtUponElem('arrowup', summaryCell.nativeElement, true, false, true);
398+
UIInteractions.triggerEventHandlerKeyDown('arrowup', gridContent, false, true);
407399
await wait(30);
408400
fix.detectChanges();
409401
expect(selectionChangeSpy).toHaveBeenCalledTimes(6);
@@ -424,15 +416,15 @@ describe('IgxTreeGrid - Multi Cell selection #tGrid', () => {
424416
const gridContent = GridFunctions.getGridContent(fix);
425417
for (let i = 8; i < 16; i++) {
426418
UIInteractions.triggerEventHandlerKeyDown('arrowdown', gridContent, false, true);
427-
await wait(30);
419+
await wait(60);
428420
fix.detectChanges();
429421
}
430422

431423
expect(selectionChangeSpy).toHaveBeenCalledTimes(5);
432424
GridSelectionFunctions.verifyCellsRegionSelected(treeGrid, 8, 15, 1, 1);
433425

434426
UIInteractions.triggerEventHandlerKeyDown('arrowdown', gridContent);
435-
await wait(30);
427+
await wait(60);
436428
fix.detectChanges();
437429

438430
GridSelectionFunctions.verifySelectedRange(treeGrid, 17, 17, 1, 1);

0 commit comments

Comments
 (0)