@@ -49,7 +49,7 @@ 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.' , ( async ( ) => {
52
+ it ( 'should allow only one cell to be selected in the whole hierarchical grid.' , ( ) => {
53
53
hierarchicalGrid . height = '500px' ;
54
54
hierarchicalGrid . reflow ( ) ;
55
55
fix . detectChanges ( ) ;
@@ -63,7 +63,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
63
63
64
64
// select parent cell
65
65
fCell . nativeElement . focus ( ) ;
66
- await wait ( 100 ) ;
67
66
fix . detectChanges ( ) ;
68
67
69
68
expect ( fCell . selected ) . toBeTruthy ( ) ;
@@ -74,7 +73,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
74
73
75
74
// select child cell
76
75
fChildCell . nativeElement . focus ( ) ;
77
- await wait ( 100 ) ;
78
76
fix . detectChanges ( ) ;
79
77
80
78
expect ( fChildCell . selected ) . toBeTruthy ( ) ;
@@ -84,11 +82,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
84
82
firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
85
83
fCell = firstRow . cells . toArray ( ) [ 0 ] ;
86
84
fCell . nativeElement . focus ( ) ;
87
- await wait ( 100 ) ;
88
85
fix . detectChanges ( ) ;
89
86
expect ( fChildCell . selected ) . toBeFalsy ( ) ;
90
87
expect ( fCell . selected ) . toBeTruthy ( ) ;
91
- } ) ) ;
88
+ } ) ;
92
89
} ) ;
93
90
94
91
describe ( 'Row Selection' , ( ) => {
@@ -100,12 +97,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
100
97
rowIsland2 = fix . componentInstance . rowIsland2 ;
101
98
} ) ) ;
102
99
103
- it ( 'should have checkboxes on each row' , fakeAsync ( ( ) => {
100
+ it ( 'should have checkboxes on each row' , ( ) => {
104
101
hierarchicalGrid . expandChildren = true ;
105
102
fix . detectChanges ( ) ;
106
- tick ( 100 ) ;
107
103
rowIsland1 . expandChildren = true ;
108
- tick ( 100 ) ;
109
104
fix . detectChanges ( ) ;
110
105
111
106
expect ( hierarchicalGrid . rowSelection ) . toEqual ( GridSelectionMode . multiple ) ;
@@ -132,7 +127,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
132
127
for ( const r of childGrid . dataRowList . toArray ( ) ) {
133
128
GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
134
129
}
135
- } ) ) ;
130
+ } ) ;
136
131
137
132
it ( 'should able to change rowSelection at runtime' , ( ) => {
138
133
hierarchicalGrid . expandChildren = true ;
@@ -144,7 +139,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
144
139
const childGridLevel2 = childGridLevel1 . hgridAPI . getChildGrids ( false ) [ 0 ] ;
145
140
146
141
hierarchicalGrid . selectAllRows ( ) ;
147
- childGridLevel1 . selectedRows ( [ '00' ] ) ;
142
+ childGridLevel1 . selectRows ( [ '00' ] ) ;
148
143
fix . detectChanges ( ) ;
149
144
150
145
// Change row selection for grids
@@ -493,7 +488,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
493
488
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
494
489
495
490
// Click on a row
496
- secondRow . nativeElement . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
491
+ secondRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
497
492
fix . detectChanges ( ) ;
498
493
499
494
GridSelectionFunctions . verifyRowSelected ( secondRow ) ;
@@ -503,7 +498,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
503
498
504
499
it ( 'should retain selected row when filtering' , ( ) => {
505
500
const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) ;
506
- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
501
+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
507
502
fix . detectChanges ( ) ;
508
503
509
504
hierarchicalGrid . filter ( 'ID' , '1' , IgxStringFilteringOperand . instance ( ) . condition ( 'doesNotContain' ) , true ) ;
@@ -513,7 +508,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
513
508
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
514
509
} ) ;
515
510
516
- it ( 'should child grid selection should not be changed when filter parent' , ( ) => {
511
+ it ( 'child grid selection should not be changed when filter parent' , ( ) => {
517
512
rowIsland1 . rowSelection = GridSelectionMode . multiple ;
518
513
fix . detectChanges ( ) ;
519
514
@@ -567,7 +562,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
567
562
firstRow . toggle ( ) ;
568
563
fix . detectChanges ( ) ;
569
564
570
- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
565
+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
571
566
fix . detectChanges ( ) ;
572
567
573
568
GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
@@ -582,15 +577,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
582
577
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
583
578
584
579
// Click on deleted row
585
- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
580
+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
586
581
fix . detectChanges ( ) ;
587
582
588
583
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
589
584
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
590
585
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
591
586
592
587
// Click on checkbox for deleted row
593
- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
588
+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
594
589
fix . detectChanges ( ) ;
595
590
596
591
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -610,7 +605,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
610
605
expect ( childGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
611
606
612
607
const childGridFirstRow = childGrid . getRowByIndex ( 0 ) ;
613
- UIInteractions . simulateClickEvent ( childGridFirstRow . nativeElement , false , true ) ;
608
+ childGridFirstRow . onClick ( UIInteractions . getMouseEvent ( 'click' , false , false , true ) ) ;
614
609
fix . detectChanges ( ) ;
615
610
616
611
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -684,7 +679,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
684
679
} ) ) ;
685
680
686
681
it ( 'should deselect deleted row' , ( ) => {
687
- GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
682
+ hierarchicalGrid . onHeaderSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
688
683
fix . detectChanges ( ) ;
689
684
690
685
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
0 commit comments