Skip to content

Commit df9200f

Browse files
HristoP96HristoP96
authored andcommitted
chore(*): Removign redundant code
1 parent 65d75d4 commit df9200f

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

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

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { async, TestBed, fakeAsync, tick } from '@angular/core/testing';
2-
import { By } from '@angular/platform-browser';
32
import { IgxGridModule } from './index';
4-
import {
5-
GridWithUndefinedDataComponent, PagingAndEditingComponent
6-
} from '../../test-utils/grid-samples.spec';
3+
import { GridWithUndefinedDataComponent } from '../../test-utils/grid-samples.spec';
74
import { PagingComponent } from '../../test-utils/grid-base-components.spec';
85
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
96

@@ -12,7 +9,6 @@ import { wait } from '../../test-utils/ui-interactions.spec';
129
import { IgxNumberFilteringOperand } from '../../data-operations/filtering-condition';
1310
import { GridFunctions, PAGER_CLASS } from '../../test-utils/grid-functions.spec';
1411
import { ControlsFunction, BUTTON_DISABLED_CLASS } from '../../test-utils/controls-functions.spec';
15-
import { DebugElement } from '@angular/core';
1612

1713
function verifyGridPager (fix, rowsCount, firstCellValue, pagerText, buttonsVisibility) {
1814
const grid = fix.componentInstance.grid;
@@ -42,7 +38,6 @@ describe('IgxGrid - Grid Paging #grid', () => {
4238
TestBed.configureTestingModule({
4339
declarations: [
4440
PagingComponent,
45-
PagingAndEditingComponent,
4641
GridWithUndefinedDataComponent
4742
],
4843
imports: [IgxGridModule, NoopAnimationsModule]
@@ -60,11 +55,6 @@ describe('IgxGrid - Grid Paging #grid', () => {
6055
grid = fix.componentInstance.grid;
6156
}));
6257

63-
afterAll(fakeAsync(() => {
64-
fix = undefined;
65-
grid = undefined;
66-
}));
67-
6858
it('should paginate data UI', () => {
6959

7060
expect(grid.paging).toBeTruthy();
@@ -454,47 +444,6 @@ describe('IgxGrid - Grid Paging #grid', () => {
454444
});
455445
});
456446

457-
it('change paging with button', () => {
458-
459-
fix = TestBed.createComponent(PagingAndEditingComponent);
460-
fix.detectChanges();
461-
grid = fix.componentInstance.grid;
462-
463-
const nextBtn: DebugElement = fix.debugElement.query(By.css('#nextPageBtn'));
464-
const prevBtn: DebugElement = fix.debugElement.query(By.css('#prevPageBtn'));
465-
const idxPageBtn: DebugElement = fix.debugElement.query(By.css('#idxPageBtn'));
466-
467-
expect(nextBtn.nativeElement).toBeTruthy();
468-
expect(nextBtn.nativeElement).toBeTruthy();
469-
expect(nextBtn.nativeElement).toBeTruthy();
470-
471-
expect(grid.paging).toBeTruthy();
472-
expect(grid.page).toEqual(0);
473-
expect(grid.perPage).toMatch('4', 'Invalid page size');
474-
verifyGridPager(fix, 4, '1', '1\xA0of\xA03', []);
475-
476-
// Next page button click
477-
GridFunctions.clickOnPaginatorButton(nextBtn);
478-
fix.detectChanges();
479-
480-
expect(grid.page).toEqual(1, 'Invalid page index');
481-
verifyGridPager(fix, 4, '5', '2\xA0of\xA03', []);
482-
483-
// Previous page button click
484-
GridFunctions.clickOnPaginatorButton(prevBtn);
485-
fix.detectChanges();
486-
487-
expect(grid.page).toEqual(0, 'Invalid page index');
488-
verifyGridPager(fix, 4, '1', '1\xA0of\xA03', []);
489-
490-
// Go to 3rd page button click
491-
GridFunctions.clickOnPaginatorButton(idxPageBtn);
492-
fix.detectChanges();
493-
494-
expect(grid.page).toEqual(2, 'Invalid page index');
495-
verifyGridPager(fix, 2, '9', '3\xA0of\xA03', []);
496-
});
497-
498447
it('should not throw error when data is undefined', fakeAsync(() => {
499448

500449
let errorMessage = '';

0 commit comments

Comments
 (0)