@@ -54,12 +54,12 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
5454 hierarchicalGrid . reflow ( ) ;
5555 fix . detectChanges ( ) ;
5656
57- const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
57+ let firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
5858 firstRow . toggle ( ) ;
5959 fix . detectChanges ( ) ;
6060 expect ( firstRow . expanded ) . toBeTruthy ( ) ;
6161
62- const fCell = firstRow . cells . toArray ( ) [ 0 ] ;
62+ let fCell = firstRow . cells . toArray ( ) [ 0 ] ;
6363
6464 // select parent cell
6565 fCell . nativeElement . focus ( ) ;
@@ -79,6 +79,8 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
7979 expect ( fCell . selected ) . toBeFalsy ( ) ;
8080
8181 // select parent cell
82+ firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
83+ fCell = firstRow . cells . toArray ( ) [ 0 ] ;
8284 fCell . nativeElement . focus ( ) ;
8385 fix . detectChanges ( ) ;
8486 expect ( fChildCell . selected ) . toBeFalsy ( ) ;
@@ -95,12 +97,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
9597 rowIsland2 = fix . componentInstance . rowIsland2 ;
9698 } ) ) ;
9799
98- it ( 'should have checkboxes on each row' , fakeAsync ( ( ) => {
100+ it ( 'should have checkboxes on each row' , ( ) => {
99101 hierarchicalGrid . expandChildren = true ;
100102 fix . detectChanges ( ) ;
101- tick ( 100 ) ;
102103 rowIsland1 . expandChildren = true ;
103- tick ( 100 ) ;
104104 fix . detectChanges ( ) ;
105105
106106 expect ( hierarchicalGrid . rowSelection ) . toEqual ( GridSelectionMode . multiple ) ;
@@ -127,7 +127,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
127127 for ( const r of childGrid . dataRowList . toArray ( ) ) {
128128 GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
129129 }
130- } ) ) ;
130+ } ) ;
131131
132132 it ( 'should able to change rowSelection at runtime' , ( ) => {
133133 hierarchicalGrid . expandChildren = true ;
@@ -139,7 +139,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
139139 const childGridLevel2 = childGridLevel1 . hgridAPI . getChildGrids ( false ) [ 0 ] ;
140140
141141 hierarchicalGrid . selectAllRows ( ) ;
142- childGridLevel1 . selectedRows ( [ '00' ] ) ;
142+ childGridLevel1 . selectRows ( [ '00' ] ) ;
143143 fix . detectChanges ( ) ;
144144
145145 // Change row selection for grids
@@ -488,7 +488,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
488488 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
489489
490490 // Click on a row
491- secondRow . nativeElement . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
491+ secondRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
492492 fix . detectChanges ( ) ;
493493
494494 GridSelectionFunctions . verifyRowSelected ( secondRow ) ;
@@ -498,7 +498,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
498498
499499 it ( 'should retain selected row when filtering' , ( ) => {
500500 const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) ;
501- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
501+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
502502 fix . detectChanges ( ) ;
503503
504504 hierarchicalGrid . filter ( 'ID' , '1' , IgxStringFilteringOperand . instance ( ) . condition ( 'doesNotContain' ) , true ) ;
@@ -508,7 +508,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
508508 GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
509509 } ) ;
510510
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' , ( ) => {
512512 rowIsland1 . rowSelection = GridSelectionMode . multiple ;
513513 fix . detectChanges ( ) ;
514514
@@ -562,7 +562,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
562562 firstRow . toggle ( ) ;
563563 fix . detectChanges ( ) ;
564564
565- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
565+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
566566 fix . detectChanges ( ) ;
567567
568568 GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
@@ -577,15 +577,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
577577 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
578578
579579 // Click on deleted row
580- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
580+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
581581 fix . detectChanges ( ) ;
582582
583583 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
584584 GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
585585 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
586586
587587 // Click on checkbox for deleted row
588- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
588+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
589589 fix . detectChanges ( ) ;
590590
591591 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -605,7 +605,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
605605 expect ( childGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
606606
607607 const childGridFirstRow = childGrid . getRowByIndex ( 0 ) ;
608- UIInteractions . simulateClickEvent ( childGridFirstRow . nativeElement , false , true ) ;
608+ childGridFirstRow . onClick ( UIInteractions . getMouseEvent ( 'click' , false , false , true ) ) ;
609609 fix . detectChanges ( ) ;
610610
611611 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -679,7 +679,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
679679 } ) ) ;
680680
681681 it ( 'should deselect deleted row' , ( ) => {
682- GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
682+ hierarchicalGrid . onHeaderSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
683683 fix . detectChanges ( ) ;
684684
685685 GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
0 commit comments