Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move keyboard tests in a separate file #3372

Merged
merged 3 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
487 changes: 0 additions & 487 deletions projects/igniteui-angular/src/lib/grids/grid/cell.spec.ts

Large diffs are not rendered by default.

1,398 changes: 1,398 additions & 0 deletions projects/igniteui-angular/src/lib/grids/grid/grid-keyBoardNav.spec.ts

Large diffs are not rendered by default.

443 changes: 27 additions & 416 deletions projects/igniteui-angular/src/lib/grids/grid/grid-selection.spec.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -753,55 +753,6 @@ describe('IgxGrid Component Tests', () => {
});
});

describe('IgxGrid - keyboard navigation tests', () => {
configureTestSuite();
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
IgxGridDefaultRenderingComponent
],
imports: [
NoopAnimationsModule, IgxGridModule.forRoot()]
}).compileComponents();
}));

it('should allow pageup/pagedown navigation when the grid is focused', async () => {
const fix = TestBed.createComponent(IgxGridDefaultRenderingComponent);
fix.detectChanges();
const grid = fix.componentInstance.grid;
const pageDownKeyEvent = new KeyboardEvent('keydown', {
code: 'PageDown',
key: 'PageDown'
});
const pageUpKeyEvent = new KeyboardEvent('keydown', {
code: 'PageUp',
key: 'PageUp'
});
let currScrollTop;
grid.width = '800px';
grid.height = '500px';
fix.componentInstance.initColumnsRows(25, 25);
await wait();
fix.detectChanges();
grid.nativeElement.dispatchEvent(new Event('focus'));

// testing the pagedown key
grid.nativeElement.dispatchEvent(pageDownKeyEvent);
grid.cdr.detectChanges();

await wait();
currScrollTop = grid.verticalScrollContainer.getVerticalScroll().scrollTop;
expect(currScrollTop).toEqual(grid.verticalScrollContainer.igxForContainerSize);

// testing the pageup key
grid.nativeElement.dispatchEvent(pageUpKeyEvent);
grid.cdr.detectChanges();
await wait();
currScrollTop = grid.parentVirtDir.getHorizontalScroll().scrollTop;
expect(currScrollTop).toEqual(0);
});
});

describe('IgxGrid - API methods', () => {
configureTestSuite();
beforeEach(async(() => {
Expand Down Expand Up @@ -1148,7 +1099,6 @@ describe('IgxGrid Component Tests', () => {
it(`Should jump from first editable columns to overlay buttons`, fakeAsync(() => {
const fixture = TestBed.createComponent(IgxGridWithEditingAndFeaturesComponent);
fixture.detectChanges();
const grid = fixture.componentInstance.grid;
const targetCell = fixture.componentInstance.focusGridCell(0, 'Downloads');
const firstCellElement = targetCell.nativeElement;
fixture.detectChanges();
Expand Down
Loading