@@ -49,14 +49,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
49
49
rowIsland2 = fix . componentInstance . rowIsland2 ;
50
50
} ) ) ;
51
51
52
- it ( 'should allow only one cell to be selected in the whole hierarchical grid.' , ( ) => {
52
+ it ( 'should allow only one cell to be selected in the whole hierarchical grid.' , fakeAsync ( ( ) => {
53
53
hierarchicalGrid . height = '500px' ;
54
54
hierarchicalGrid . reflow ( ) ;
55
55
fix . detectChanges ( ) ;
56
56
57
57
let firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
58
58
firstRow . toggle ( ) ;
59
59
fix . detectChanges ( ) ;
60
+ tick ( 100 ) ;
60
61
expect ( firstRow . expanded ) . toBeTruthy ( ) ;
61
62
62
63
let fCell = firstRow . cells . toArray ( ) [ 0 ] ;
@@ -85,7 +86,8 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
85
86
fix . detectChanges ( ) ;
86
87
expect ( fChildCell . selected ) . toBeFalsy ( ) ;
87
88
expect ( fCell . selected ) . toBeTruthy ( ) ;
88
- } ) ;
89
+ } ) ) ;
90
+
89
91
} ) ;
90
92
91
93
describe ( 'Row Selection' , ( ) => {
@@ -97,10 +99,12 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
97
99
rowIsland2 = fix . componentInstance . rowIsland2 ;
98
100
} ) ) ;
99
101
100
- it ( 'should have checkboxes on each row' , ( ) => {
102
+ it ( 'should have checkboxes on each row' , fakeAsync ( ( ) => {
101
103
hierarchicalGrid . expandChildren = true ;
104
+ tick ( 100 ) ;
102
105
fix . detectChanges ( ) ;
103
106
rowIsland1 . expandChildren = true ;
107
+ tick ( 100 ) ;
104
108
fix . detectChanges ( ) ;
105
109
106
110
expect ( hierarchicalGrid . rowSelection ) . toEqual ( GridSelectionMode . multiple ) ;
@@ -127,7 +131,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
127
131
for ( const r of childGrid . dataRowList . toArray ( ) ) {
128
132
GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
129
133
}
130
- } ) ;
134
+ } ) ) ;
131
135
132
136
it ( 'should able to change rowSelection at runtime' , ( ) => {
133
137
hierarchicalGrid . expandChildren = true ;
@@ -556,13 +560,14 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
556
560
GridSelectionFunctions . verifyRowsArraySelected ( childGrid . dataRowList . toArray ( ) ) ;
557
561
} ) ;
558
562
559
- it ( 'should not be able to select deleted row' , ( ) => {
563
+ it ( 'should not be able to select deleted row' , fakeAsync ( ( ) => {
560
564
// Expand first row
561
565
const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
562
566
firstRow . toggle ( ) ;
563
567
fix . detectChanges ( ) ;
564
568
565
569
firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
570
+ tick ( ) ;
566
571
fix . detectChanges ( ) ;
567
572
568
573
GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
@@ -578,6 +583,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
578
583
579
584
// Click on deleted row
580
585
firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
586
+ tick ( ) ;
581
587
fix . detectChanges ( ) ;
582
588
583
589
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -606,13 +612,14 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
606
612
607
613
const childGridFirstRow = childGrid . getRowByIndex ( 0 ) ;
608
614
childGridFirstRow . onClick ( UIInteractions . getMouseEvent ( 'click' , false , false , true ) ) ;
615
+ tick ( ) ;
609
616
fix . detectChanges ( ) ;
610
617
611
618
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
612
619
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , true ) ;
613
620
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
614
621
expect ( childGrid . selectedRows ( ) ) . toEqual ( [ '00' ] ) ;
615
- } ) ;
622
+ } ) ) ;
616
623
617
624
it ( 'should be able to select added row' , ( ) => {
618
625
// Set multiple selection to first row island
0 commit comments