@@ -54,12 +54,12 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
54
54
hierarchicalGrid . reflow ( ) ;
55
55
fix . detectChanges ( ) ;
56
56
57
- const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
57
+ let firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
58
58
firstRow . toggle ( ) ;
59
59
fix . detectChanges ( ) ;
60
60
expect ( firstRow . expanded ) . toBeTruthy ( ) ;
61
61
62
- const fCell = firstRow . cells . toArray ( ) [ 0 ] ;
62
+ let fCell = firstRow . cells . toArray ( ) [ 0 ] ;
63
63
64
64
// select parent cell
65
65
fCell . nativeElement . focus ( ) ;
@@ -79,6 +79,8 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
79
79
expect ( fCell . selected ) . toBeFalsy ( ) ;
80
80
81
81
// select parent cell
82
+ firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
83
+ fCell = firstRow . cells . toArray ( ) [ 0 ] ;
82
84
fCell . nativeElement . focus ( ) ;
83
85
fix . detectChanges ( ) ;
84
86
expect ( fChildCell . selected ) . toBeFalsy ( ) ;
@@ -95,12 +97,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
95
97
rowIsland2 = fix . componentInstance . rowIsland2 ;
96
98
} ) ) ;
97
99
98
- it ( 'should have checkboxes on each row' , fakeAsync ( ( ) => {
100
+ it ( 'should have checkboxes on each row' , ( ) => {
99
101
hierarchicalGrid . expandChildren = true ;
100
102
fix . detectChanges ( ) ;
101
- tick ( 100 ) ;
102
103
rowIsland1 . expandChildren = true ;
103
- tick ( 100 ) ;
104
104
fix . detectChanges ( ) ;
105
105
106
106
expect ( hierarchicalGrid . rowSelection ) . toEqual ( GridSelectionMode . multiple ) ;
@@ -127,7 +127,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
127
127
for ( const r of childGrid . dataRowList . toArray ( ) ) {
128
128
GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
129
129
}
130
- } ) ) ;
130
+ } ) ;
131
131
132
132
it ( 'should able to change rowSelection at runtime' , ( ) => {
133
133
hierarchicalGrid . expandChildren = true ;
@@ -139,7 +139,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
139
139
const childGridLevel2 = childGridLevel1 . hgridAPI . getChildGrids ( false ) [ 0 ] ;
140
140
141
141
hierarchicalGrid . selectAllRows ( ) ;
142
- childGridLevel1 . selectedRows ( [ '00' ] ) ;
142
+ childGridLevel1 . selectRows ( [ '00' ] ) ;
143
143
fix . detectChanges ( ) ;
144
144
145
145
// Change row selection for grids
@@ -488,7 +488,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
488
488
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
489
489
490
490
// Click on a row
491
- secondRow . nativeElement . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
491
+ secondRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
492
492
fix . detectChanges ( ) ;
493
493
494
494
GridSelectionFunctions . verifyRowSelected ( secondRow ) ;
@@ -498,7 +498,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
498
498
499
499
it ( 'should retain selected row when filtering' , ( ) => {
500
500
const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) ;
501
- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
501
+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
502
502
fix . detectChanges ( ) ;
503
503
504
504
hierarchicalGrid . filter ( 'ID' , '1' , IgxStringFilteringOperand . instance ( ) . condition ( 'doesNotContain' ) , true ) ;
@@ -508,7 +508,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
508
508
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
509
509
} ) ;
510
510
511
- it ( 'should child grid selection should not be changed when filter parent' , ( ) => {
511
+ it ( 'child grid selection should not be changed when filter parent' , ( ) => {
512
512
rowIsland1 . rowSelection = GridSelectionMode . multiple ;
513
513
fix . detectChanges ( ) ;
514
514
@@ -562,7 +562,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
562
562
firstRow . toggle ( ) ;
563
563
fix . detectChanges ( ) ;
564
564
565
- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
565
+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
566
566
fix . detectChanges ( ) ;
567
567
568
568
GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
@@ -577,15 +577,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
577
577
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
578
578
579
579
// Click on deleted row
580
- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
580
+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
581
581
fix . detectChanges ( ) ;
582
582
583
583
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
584
584
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
585
585
expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
586
586
587
587
// Click on checkbox for deleted row
588
- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
588
+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
589
589
fix . detectChanges ( ) ;
590
590
591
591
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -605,7 +605,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
605
605
expect ( childGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
606
606
607
607
const childGridFirstRow = childGrid . getRowByIndex ( 0 ) ;
608
- UIInteractions . simulateClickEvent ( childGridFirstRow . nativeElement , false , true ) ;
608
+ childGridFirstRow . onClick ( UIInteractions . getMouseEvent ( 'click' , false , false , true ) ) ;
609
609
fix . detectChanges ( ) ;
610
610
611
611
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -679,7 +679,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
679
679
} ) ) ;
680
680
681
681
it ( 'should deselect deleted row' , ( ) => {
682
- GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
682
+ hierarchicalGrid . onHeaderSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
683
683
fix . detectChanges ( ) ;
684
684
685
685
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
0 commit comments