Skip to content

Commit 148fb2c

Browse files
committed
chore(*): Apply review notes
1 parent e22ced5 commit 148fb2c

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { IGridCellEventArgs } from '../common/events';
1414
import { IgxColumnComponent } from '../columns/column.component';
1515
import { ColumnPinningPosition } from '../common/enums';
1616
import { IPinningConfig } from '../common/grid.interface';
17-
import { wait } from '../../test-utils/ui-interactions.spec';
17+
import { wait, UIInteractions } from '../../test-utils/ui-interactions.spec';
1818
import { GridSummaryFunctions } from '../../test-utils/grid-functions.spec';
1919

2020
describe('IgxGrid - Column Pinning #grid', () => {
@@ -436,17 +436,15 @@ describe('IgxGrid - Column Pinning #grid', () => {
436436
grid.navigation.activeNode = {row: cellContactName.rowIndex, column: cellContactName.visibleColumnIndex};
437437
fix.detectChanges();
438438

439-
const keydownArrowRightEvent = new KeyboardEvent('keydown', {key: 'ArrowRight'});
440-
grid.navigation.dispatchEvent(keydownArrowRightEvent);
439+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowRight'));
441440
await wait(DEBOUNCETIME);
442441
fix.detectChanges();
443442

444443
const cellID = grid.getCellByColumn(0, 'ID');
445444
expect(cellID.active).toBe(true);
446445
expect(cellContactName.active).toBe(false);
447446

448-
const keydownArrowLeftEvent = new KeyboardEvent('keydown', {key: 'ArrowLeft'});
449-
grid.navigation.dispatchEvent(keydownArrowLeftEvent);
447+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowLeft'));
450448
await wait(DEBOUNCETIME);
451449
fix.detectChanges();
452450

@@ -689,16 +687,14 @@ describe('IgxGrid - Column Pinning #grid', () => {
689687
fix.detectChanges();
690688
expect(cellCompanyName.active).toBe(true);
691689

692-
const keydownArrowLeftEvent = new KeyboardEvent('keydown', {key: 'ArrowLeft'});
693-
grid.navigation.dispatchEvent(keydownArrowLeftEvent);
690+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowLeft'));
694691
await wait(DEBOUNCETIME);
695692
fix.detectChanges();
696693
const cellFax = grid.getCellByColumn(0, 'Fax');
697694
expect(cellFax.active).toBe(true);
698695
expect(cellCompanyName.active).toBe(false);
699696

700-
const keydownArrowRightEvent = new KeyboardEvent('keydown', {key: 'ArrowRight'});
701-
grid.navigation.dispatchEvent(keydownArrowRightEvent);
697+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowRight'));
702698
await wait(DEBOUNCETIME);
703699
fix.detectChanges();
704700
expect(cellFax.active).toBe(false);
@@ -718,16 +714,14 @@ describe('IgxGrid - Column Pinning #grid', () => {
718714
fix.detectChanges();
719715
expect(cellCompanyName.active).toBe(true);
720716

721-
const keydownArrowLeftEvent = new KeyboardEvent('keydown', {key: 'ArrowLeft', ctrlKey: true});
722-
grid.navigation.dispatchEvent(keydownArrowLeftEvent);
717+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowLeft', false, false, true));
723718
await wait(DEBOUNCETIME);
724719
fix.detectChanges();
725720
const cellID = grid.getCellByColumn(0, 'ID');
726721
expect(cellID.active).toBe(true);
727722
expect(cellCompanyName.active).toBe(false);
728723

729-
const keydownArrowRightEvent = new KeyboardEvent('keydown', {key: 'ArrowRight', ctrlKey: true});
730-
grid.navigation.dispatchEvent(keydownArrowRightEvent);
724+
grid.navigation.dispatchEvent(UIInteractions.getKeyboardEvent('keydown', 'ArrowRight', false, false, true));
731725
await wait(DEBOUNCETIME);
732726
fix.detectChanges();
733727
const cellContactName = grid.getCellByColumn(0, 'ContactName');

0 commit comments

Comments
 (0)