Skip to content

Commit 2355888

Browse files
HristoP96HristoP96
authored andcommitted
chore(*): make async fakeasync
1 parent b53a710 commit 2355888

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
4949
rowIsland2 = fix.componentInstance.rowIsland2;
5050
}));
5151

52-
it('should allow only one cell to be selected in the whole hierarchical grid.', (async () => {
52+
it('should allow only one cell to be selected in the whole hierarchical grid.', fakeAsync(() => {
5353
hierarchicalGrid.height = '500px';
5454
hierarchicalGrid.reflow();
5555
fix.detectChanges();
5656

5757
let firstRow = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
5858
firstRow.toggle();
5959
fix.detectChanges();
60+
tick(100);
6061
expect(firstRow.expanded).toBeTruthy();
6162

6263
let fCell = firstRow.cells.toArray()[0];
6364

6465
// select parent cell
6566
fCell.nativeElement.focus();
66-
await wait(100);
6767
fix.detectChanges();
6868

6969
expect(fCell.selected).toBeTruthy();
@@ -74,7 +74,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
7474

7575
// select child cell
7676
fChildCell.nativeElement.focus();
77-
await wait(100);
7877
fix.detectChanges();
7978

8079
expect(fChildCell.selected).toBeTruthy();
@@ -84,11 +83,11 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
8483
firstRow = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
8584
fCell = firstRow.cells.toArray()[0];
8685
fCell.nativeElement.focus();
87-
await wait(100);
8886
fix.detectChanges();
8987
expect(fChildCell.selected).toBeFalsy();
9088
expect(fCell.selected).toBeTruthy();
9189
}));
90+
9291
});
9392

9493
describe('Row Selection', () => {
@@ -100,12 +99,12 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
10099
rowIsland2 = fix.componentInstance.rowIsland2;
101100
}));
102101

103-
it('should have checkboxes on each row', ( async() => {
102+
it('should have checkboxes on each row', fakeAsync(() => {
104103
hierarchicalGrid.expandChildren = true;
105-
await wait(100);
104+
tick(100);
106105
fix.detectChanges();
107106
rowIsland1.expandChildren = true;
108-
await wait(100);
107+
tick(100);
109108
fix.detectChanges();
110109

111110
expect(hierarchicalGrid.rowSelection).toEqual(GridSelectionMode.multiple);

0 commit comments

Comments
 (0)