Skip to content

Commit 90c42f7

Browse files
committed
test(Grids): #5005 Revert beforeEach.
1 parent b8ca431 commit 90c42f7

11 files changed

+67
-32
lines changed

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ describe('IgxTreeGrid - CRUD', () => {
3434
describe('Child Collection', () => {
3535
// configureTestSuite();
3636

37-
beforeEach(async(/** height/width setter rAF */() => {
37+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
3838
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
3939
fix.detectChanges();
40+
tick(16);
4041
treeGrid = fix.componentInstance.treeGrid;
4142
treeGrid.height = '800px';
4243
fix.detectChanges();
44+
tick(16);
4345
}));
4446

4547
it('should support adding root row through treeGrid API', () => {
@@ -194,12 +196,13 @@ describe('IgxTreeGrid - CRUD', () => {
194196

195197
describe('Primary/Foreign key', () => {
196198
// configureTestSuite();
197-
beforeEach(async(/** height/width setter rAF */() => {
199+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
198200
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
199201
fix.detectChanges();
200202
treeGrid = fix.componentInstance.treeGrid;
201203
treeGrid.height = '800px';
202204
fix.detectChanges();
205+
tick(16);
203206
}));
204207

205208
it('should support adding root row through treeGrid API', () => {
@@ -299,9 +302,10 @@ describe('IgxTreeGrid - CRUD', () => {
299302
describe('Update API', () => {
300303
describe('Child Collection', () => {
301304
// configureTestSuite();
302-
beforeEach(async(/** height/width setter rAF */() => {
305+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
303306
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
304307
fix.detectChanges();
308+
tick(16);
305309
treeGrid = fix.componentInstance.treeGrid;
306310
}));
307311

@@ -453,9 +457,10 @@ describe('IgxTreeGrid - CRUD', () => {
453457

454458
describe('Primary/Foreign key', () => {
455459
// configureTestSuite();
456-
beforeEach(async(/** height/width setter rAF */() => {
460+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
457461
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
458462
fix.detectChanges();
463+
tick(16);
459464
treeGrid = fix.componentInstance.treeGrid;
460465
}));
461466

@@ -679,9 +684,10 @@ describe('IgxTreeGrid - CRUD', () => {
679684
describe('Update UI', () => {
680685
describe('Child Collection', () => {
681686
// configureTestSuite();
682-
beforeEach(async(/** height/width setter rAF */() => {
687+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
683688
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
684689
fix.detectChanges();
690+
tick(16);
685691
treeGrid = fix.componentInstance.treeGrid;
686692
for (const col of treeGrid.columns) {
687693
col.editable = true;
@@ -848,9 +854,10 @@ describe('IgxTreeGrid - CRUD', () => {
848854

849855
describe('Primary/Foreign key', () => {
850856
// configureTestSuite();
851-
beforeEach(async(/** height/width setter rAF */() => {
857+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
852858
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
853859
fix.detectChanges();
860+
tick(16);
854861
treeGrid = fix.componentInstance.treeGrid;
855862
for (const col of treeGrid.columns) {
856863
col.editable = true;
@@ -1017,9 +1024,10 @@ describe('IgxTreeGrid - CRUD', () => {
10171024
describe('Delete', () => {
10181025
describe('Child Collection', () => {
10191026
// configureTestSuite();
1020-
beforeEach(async(/** height/width setter rAF */() => {
1027+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
10211028
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
10221029
fix.detectChanges();
1030+
tick(16);
10231031
treeGrid = fix.componentInstance.treeGrid;
10241032
}));
10251033

@@ -1118,9 +1126,10 @@ describe('IgxTreeGrid - CRUD', () => {
11181126

11191127
describe('Primary/Foreign key', () => {
11201128
// configureTestSuite();
1121-
beforeEach(async(/** height/width setter rAF */() => {
1129+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
11221130
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
11231131
fix.detectChanges();
1132+
tick(16);
11241133
treeGrid = fix.componentInstance.treeGrid;
11251134
treeGrid.cascadeOnDelete = false;
11261135
}));

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ describe('IgxTreeGrid - Expanding / Collapsing', () => {
3636
}));
3737

3838
describe('Child Collection', () => {
39-
beforeEach(async(/** height/width setter rAF */() => {
39+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
4040
fix = TestBed.createComponent(IgxTreeGridExpandingComponent);
4141
fix.detectChanges();
42+
tick(16);
4243
treeGrid = fix.componentInstance.treeGrid;
4344
}));
4445

@@ -439,9 +440,10 @@ describe('IgxTreeGrid - Expanding / Collapsing', () => {
439440
});
440441

441442
describe('Primary/Foreign key', () => {
442-
beforeEach(async(/** height/width setter rAF */() => {
443+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
443444
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
444445
fix.detectChanges();
446+
tick(16);
445447
treeGrid = fix.componentInstance.treeGrid;
446448
treeGrid.expansionDepth = 0;
447449
fix.detectChanges();
@@ -833,9 +835,10 @@ describe('IgxTreeGrid - Expanding / Collapsing', () => {
833835
describe('Load On Demand', () => {
834836

835837
describe('Primary/Foreign key', () => {
836-
beforeEach(async(/** height/width setter rAF */() => {
838+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
837839
fix = TestBed.createComponent(IgxTreeGridLoadOnDemandComponent);
838840
fix.detectChanges();
841+
tick(16);
839842
treeGrid = fix.componentInstance.treeGrid;
840843
}));
841844

@@ -889,9 +892,10 @@ describe('IgxTreeGrid - Expanding / Collapsing', () => {
889892
});
890893

891894
describe('ChildDataKey', () => {
892-
beforeEach(async(/** height/width setter rAF */() => {
895+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
893896
fix = TestBed.createComponent(IgxTreeGridLoadOnDemandChildDataComponent);
894897
fix.detectChanges();
898+
tick(16);
895899
treeGrid = fix.componentInstance.treeGrid;
896900
}));
897901

@@ -945,9 +949,10 @@ describe('IgxTreeGrid - Expanding / Collapsing', () => {
945949
});
946950

947951
describe('HasChildrenKey', () => {
948-
beforeEach(async(/** height/width setter rAF */() => {
952+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
949953
fix = TestBed.createComponent(IgxTreeGridLoadOnDemandHasChildrenComponent);
950954
fix.detectChanges();
955+
tick(16);
951956
treeGrid = fix.componentInstance.treeGrid;
952957
}));
953958

@@ -1002,9 +1007,10 @@ describe('Row editing expanding/collapsing', () => {
10021007
.compileComponents();
10031008
}));
10041009

1005-
beforeEach(async(/** height/width setter rAF */() => {
1010+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
10061011
fix = TestBed.createComponent(IgxTreeGridRowEditingComponent);
10071012
fix.detectChanges();
1013+
tick(16);
10081014
treeGrid = fix.componentInstance.treeGrid;
10091015
}));
10101016

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ describe('IgxTreeGrid - Filtering actions', () => {
2424
.compileComponents();
2525
}));
2626

27-
beforeEach(async(/** height/width setter rAF */() => {
27+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
2828
fix = TestBed.createComponent(IgxTreeGridFilteringComponent);
2929
fix.detectChanges();
30+
tick(16);
3031
grid = fix.componentInstance.treeGrid;
3132
}));
3233

@@ -275,9 +276,10 @@ describe('IgxTreeGrid - Filtering actions', () => {
275276

276277
describe('Filtering: Row editing', () => {
277278
let treeGrid: IgxTreeGridComponent;
278-
beforeEach(async(/** height/width setter rAF */() => {
279+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
279280
fix = TestBed.createComponent(IgxTreeGridFilteringRowEditingComponent);
280281
fix.detectChanges();
282+
tick(16);
281283
treeGrid = fix.componentInstance.treeGrid;
282284
}));
283285

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ describe('IgxTreeGrid - Indentation', () => {
3131

3232
describe('Child Collection', () => {
3333
// configureTestSuite();
34-
beforeEach(async(/** height/width setter rAF */() => {
34+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
3535
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
3636
fix.detectChanges();
37+
tick(16);
3738
treeGrid = fix.componentInstance.treeGrid;
3839
}));
3940

@@ -188,9 +189,10 @@ describe('IgxTreeGrid - Indentation', () => {
188189

189190
describe('Primary/Foreign key', () => {
190191
// configureTestSuite();
191-
beforeEach(async(/** height/width setter rAF */() => {
192+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
192193
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
193194
fix.detectChanges();
195+
tick(16);
194196
treeGrid = fix.componentInstance.treeGrid;
195197
}));
196198

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ describe('IgxTreeGrid - Integration', () => {
8383

8484
describe('Child Collection', () => {
8585
// configureTestSuite();
86-
beforeEach(async(/** height/width setter rAF */() => {
86+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
8787
fix = TestBed.createComponent(IgxTreeGridSimpleComponent);
8888
fix.detectChanges();
89+
tick(16);
8990
treeGrid = fix.componentInstance.treeGrid;
9091
}));
9192

@@ -195,9 +196,10 @@ describe('IgxTreeGrid - Integration', () => {
195196

196197
describe('Primary/Foreign key', () => {
197198
// configureTestSuite();
198-
beforeEach(async(/** height/width setter rAF */() => {
199+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
199200
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
200201
fix.detectChanges();
202+
tick(16);
201203
treeGrid = fix.componentInstance.treeGrid;
202204
}));
203205

@@ -306,9 +308,10 @@ describe('IgxTreeGrid - Integration', () => {
306308
});
307309

308310
describe('Row editing', () => {
309-
beforeEach(async(/** height/width setter rAF */() => {
311+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
310312
fix = TestBed.createComponent(IgxTreeGridRowEditingComponent);
311313
fix.detectChanges();
314+
tick(16);
312315
treeGrid = fix.componentInstance.treeGrid;
313316
}));
314317

@@ -1162,9 +1165,10 @@ describe('IgxTreeGrid - Integration', () => {
11621165
});
11631166

11641167
describe('Multi-column header', () => {
1165-
beforeEach(async(/** height/width setter rAF */() => {
1168+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
11661169
fix = TestBed.createComponent(IgxTreeGridMultiColHeadersComponent);
11671170
fix.detectChanges();
1171+
tick(16);
11681172
treeGrid = fix.componentInstance.treeGrid;
11691173
}));
11701174

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ describe('IgxTreeGrid - Key Board Navigation', () => {
3030
describe('Navigation with no scroll', () => {
3131
// configureTestSuite();
3232

33-
beforeEach(async(/** height/width setter rAF */() => {
33+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
3434
fix = TestBed.createComponent(IgxTreeGridWithNoScrollsComponent);
3535
fix.detectChanges();
36+
tick(16);
3637
treeGrid = fix.componentInstance.treeGrid;
3738
}));
3839

@@ -156,12 +157,13 @@ describe('IgxTreeGrid - Key Board Navigation', () => {
156157
describe('Navigation with scrolls', () => {
157158
// configureTestSuite();
158159

159-
beforeEach(async(/** height/width setter rAF */() => {
160+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
160161
fix = TestBed.createComponent(IgxTreeGridWithScrollsComponent);
161162
fix.detectChanges();
162-
163+
tick(16);
163164
treeGrid = fix.componentInstance.treeGrid;
164165
setupGridScrollDetection(fix, treeGrid);
166+
tick(16);
165167
}));
166168

167169
it('should navigate with arrow Up and Down keys on gridCells', async () => {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ describe('IgxTreeGrid - search API', () => {
3434
}));
3535

3636
describe('Child Collection', () => {
37-
beforeEach(async(/** height/width setter rAF */() => {
37+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
3838
fix = TestBed.createComponent(IgxTreeGridSearchComponent);
3939
fix.detectChanges();
40+
tick(16);
4041
fixNativeElement = fix.debugElement.nativeElement;
4142
treeGrid = fix.componentInstance.treeGrid;
4243

4344
treeGrid.getColumnByName('JobTitle').autosize();
4445
fix.detectChanges();
46+
tick(16);
4547
}));
4648

4749
it('Search highlights should work within tree cell', () => {
@@ -111,9 +113,10 @@ describe('IgxTreeGrid - search API', () => {
111113
});
112114

113115
describe('Primary/Foreign key', () => {
114-
beforeEach(async(/** height/width setter rAF */() => {
116+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
115117
fix = TestBed.createComponent(IgxTreeGridPrimaryForeignKeyComponent);
116118
fix.detectChanges();
119+
tick(16);
117120
fixNativeElement = fix.debugElement.nativeElement;
118121
treeGrid = fix.componentInstance.treeGrid;
119122
}));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,10 @@ describe('IgxTreeGrid - Selection', () => {
407407

408408
describe('Cell Selection', () => {
409409
// configureTestSuite();
410-
beforeEach(async(/** height/width setter rAF */() => {
410+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
411411
fix = TestBed.createComponent(IgxTreeGridCellSelectionComponent);
412412
fix.detectChanges();
413+
tick(16);
413414
treeGrid = fix.componentInstance.treeGrid;
414415
}));
415416

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ describe('IgxTreeGrid - Sorting', () => {
2323
.compileComponents();
2424
}));
2525

26-
beforeEach(async(/** height/width setter rAF */() => {
26+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
2727
fix = TestBed.createComponent(IgxTreeGridSortingComponent);
2828
fix.detectChanges();
29+
tick(16);
2930
treeGrid = fix.componentInstance.treeGrid;
3031
}));
3132

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,13 @@ describe('IgxTreeGrid - Summaries', () => {
678678
describe('CRUD with transactions', () => {
679679
let fix;
680680
let treeGrid;
681-
beforeEach(async(/** height/width setter rAF */() => {
681+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
682682
fix = TestBed.createComponent(IgxTreeGridSummariesTransactionsComponent);
683683
fix.detectChanges();
684+
tick(16);
684685
treeGrid = fix.componentInstance.treeGrid;
685686
setupGridScrollDetection(fix, treeGrid);
687+
tick(16);
686688
}));
687689

688690
it('Delete root node', () => {
@@ -1193,11 +1195,13 @@ describe('IgxTreeGrid - Summaries', () => {
11931195
describe('Keyboard Navigation', () => {
11941196
let fix;
11951197
let treeGrid;
1196-
beforeEach(async(/** height/width setter rAF */() => {
1198+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
11971199
fix = TestBed.createComponent(IgxTreeGridSummariesKeyScroliingComponent);
11981200
fix.detectChanges();
1201+
tick(16);
11991202
treeGrid = fix.componentInstance.treeGrid;
12001203
setupGridScrollDetection(fix, treeGrid);
1204+
tick(16);
12011205
}));
12021206

12031207
it('should be able to select root summaries with arrow keys', async () => {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ describe('IgxTreeGrid Component Tests', () => {
3232

3333
describe('IgxTreeGrid - default rendering for rows and columns', () => {
3434

35-
beforeEach(async(/** height/width setter rAF */() => {
35+
beforeEach(fakeAsync(/** height/width setter rAF */() => {
3636
fix = TestBed.createComponent(IgxTreeGridWrappedInContComponent);
3737
fix.detectChanges();
38+
tick(16);
3839
grid = fix.componentInstance.treeGrid;
3940
}));
4041

0 commit comments

Comments
 (0)