Skip to content

Commit b08e01c

Browse files
authored
test(tree-grid): refactoring filtering spec (#12348)
* test(tree-grid): refactoring filtering spec * test(tree-grid): removing all async tests filterin * test(hgrid): refactoring more spec files
1 parent f487c90 commit b08e01c

File tree

4 files changed

+104
-136
lines changed

4 files changed

+104
-136
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { configureTestSuite } from '../../test-utils/configure-suite';
2-
import { TestBed, tick, fakeAsync, ComponentFixture } from '@angular/core/testing';
2+
import { TestBed, tick, fakeAsync, ComponentFixture, waitForAsync } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
44
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
55
import { IgxHierarchicalGridModule } from './public_api';
@@ -32,21 +32,23 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
3232
const FILTERING_ROW_CLASS = 'igx-grid-filtering-row';
3333
const FILTERING_CELL_CLASS = 'igx-grid-filtering-cell';
3434

35-
configureTestSuite((() => {
35+
configureTestSuite();
36+
37+
beforeAll(waitForAsync(() => {
3638
TestBed.configureTestingModule({
3739
declarations: [
3840
IgxHierarchicalGridTestBaseComponent,
3941
IgxHierarchicalGridTestCustomToolbarComponent,
4042
IgxHierarchicalGridWithTransactionProviderComponent
4143
],
4244
imports: [
43-
NoopAnimationsModule, IgxHierarchicalGridModule, IgxIconModule]
44-
});
45-
}));
45+
NoopAnimationsModule, IgxHierarchicalGridModule, IgxIconModule
46+
]
47+
}).compileComponents();
48+
}))
4649

47-
beforeEach(fakeAsync(() => {
50+
beforeEach(waitForAsync(() => {
4851
fixture = TestBed.createComponent(IgxHierarchicalGridTestBaseComponent);
49-
tick();
5052
fixture.detectChanges();
5153
hierarchicalGrid = fixture.componentInstance.hgrid;
5254
}));
@@ -894,6 +896,7 @@ describe('IgxHierarchicalGrid Integration #hGrid', () => {
894896
const FIXED_ROW_CONTAINER = '.igx-grid__tr--pinned';
895897
const FIXED_ROW_CONTAINER_TOP = 'igx-grid__tr--pinned-top';
896898
const FIXED_ROW_CONTAINER_BOTTOM = 'igx-grid__tr--pinned-bottom';
899+
897900
beforeEach(() => {
898901
hierarchicalGrid.width = '800px';
899902
hierarchicalGrid.height = '500px';

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

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@ describe('IgxHierarchicalGrid Navigation', () => {
2323
let baseHGridContent: DebugElement;
2424
configureTestSuite();
2525

26+
beforeAll(waitForAsync(() => {
27+
TestBed.configureTestingModule({
28+
declarations: [
29+
IgxHierarchicalGridTestBaseComponent,
30+
IgxHierarchicalGridTestComplexComponent,
31+
IgxHierarchicalGridMultiLayoutComponent,
32+
IgxHierarchicalGridSmallerChildComponent
33+
],
34+
imports: [
35+
NoopAnimationsModule, IgxHierarchicalGridModule
36+
]
37+
}).compileComponents();
38+
}));
39+
2640
describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
27-
beforeAll(waitForAsync(() => {
28-
TestBed.configureTestingModule({
29-
declarations: [
30-
IgxHierarchicalGridTestBaseComponent
31-
],
32-
imports: [
33-
NoopAnimationsModule, IgxHierarchicalGridModule
34-
]
35-
}).compileComponents();
36-
}));
3741

3842
beforeEach(waitForAsync(() => {
3943
fixture = TestBed.createComponent(IgxHierarchicalGridTestBaseComponent);
@@ -630,16 +634,6 @@ describe('IgxHierarchicalGrid Navigation', () => {
630634

631635

632636
describe('IgxHierarchicalGrid Complex Navigation #hGrid', () => {
633-
beforeAll(waitForAsync(() => {
634-
TestBed.configureTestingModule({
635-
declarations: [
636-
IgxHierarchicalGridTestComplexComponent
637-
],
638-
imports: [
639-
NoopAnimationsModule, IgxHierarchicalGridModule
640-
]
641-
}).compileComponents();
642-
}));
643637

644638
beforeEach(waitForAsync(() => {
645639
fixture = TestBed.createComponent(IgxHierarchicalGridTestComplexComponent);
@@ -753,16 +747,6 @@ describe('IgxHierarchicalGrid Navigation', () => {
753747
});
754748

755749
describe('IgxHierarchicalGrid sibling row islands Navigation #hGrid', () => {
756-
beforeAll(waitForAsync(() => {
757-
TestBed.configureTestingModule({
758-
declarations: [
759-
IgxHierarchicalGridMultiLayoutComponent
760-
],
761-
imports: [
762-
NoopAnimationsModule, IgxHierarchicalGridModule
763-
]
764-
}).compileComponents();
765-
}));
766750

767751
beforeEach(waitForAsync(() => {
768752
fixture = TestBed.createComponent(IgxHierarchicalGridMultiLayoutComponent);
@@ -884,16 +868,6 @@ describe('IgxHierarchicalGrid Navigation', () => {
884868
});
885869

886870
describe('IgxHierarchicalGrid Smaller Child Navigation #hGrid', () => {
887-
beforeAll(waitForAsync(() => {
888-
TestBed.configureTestingModule({
889-
declarations: [
890-
IgxHierarchicalGridSmallerChildComponent
891-
],
892-
imports: [
893-
NoopAnimationsModule, IgxHierarchicalGridModule
894-
]
895-
}).compileComponents();
896-
}));
897871

898872
beforeEach(waitForAsync(() => {
899873
fixture = TestBed.createComponent(IgxHierarchicalGridSmallerChildComponent);

0 commit comments

Comments
 (0)