@@ -49,7 +49,7 @@ 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.' , ( ) => {
5353 hierarchicalGrid . height = '500px' ;
5454 hierarchicalGrid . reflow ( ) ;
5555 fix . detectChanges ( ) ;
@@ -63,7 +63,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
6363
6464 // select parent cell
6565 fCell . nativeElement . focus ( ) ;
66- await wait ( 100 ) ;
6766 fix . detectChanges ( ) ;
6867
6968 expect ( fCell . selected ) . toBeTruthy ( ) ;
@@ -74,7 +73,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
7473
7574 // select child cell
7675 fChildCell . nativeElement . focus ( ) ;
77- await wait ( 100 ) ;
7876 fix . detectChanges ( ) ;
7977
8078 expect ( fChildCell . selected ) . toBeTruthy ( ) ;
@@ -84,11 +82,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
8482 firstRow = hierarchicalGrid . getRowByIndex ( 0 ) as IgxHierarchicalRowComponent ;
8583 fCell = firstRow . cells . toArray ( ) [ 0 ] ;
8684 fCell . nativeElement . focus ( ) ;
87- await wait ( 100 ) ;
8885 fix . detectChanges ( ) ;
8986 expect ( fChildCell . selected ) . toBeFalsy ( ) ;
9087 expect ( fCell . selected ) . toBeTruthy ( ) ;
91- } ) ) ;
88+ } ) ;
9289 } ) ;
9390
9491 describe ( 'Row Selection' , ( ) => {
@@ -100,12 +97,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
10097 rowIsland2 = fix . componentInstance . rowIsland2 ;
10198 } ) ) ;
10299
103- it ( 'should have checkboxes on each row' , fakeAsync ( ( ) => {
100+ it ( 'should have checkboxes on each row' , ( ) => {
104101 hierarchicalGrid . expandChildren = true ;
105102 fix . detectChanges ( ) ;
106- tick ( 100 ) ;
107103 rowIsland1 . expandChildren = true ;
108- tick ( 100 ) ;
109104 fix . detectChanges ( ) ;
110105
111106 expect ( hierarchicalGrid . rowSelection ) . toEqual ( GridSelectionMode . multiple ) ;
@@ -132,7 +127,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
132127 for ( const r of childGrid . dataRowList . toArray ( ) ) {
133128 GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
134129 }
135- } ) ) ;
130+ } ) ;
136131
137132 it ( 'should able to change rowSelection at runtime' , ( ) => {
138133 hierarchicalGrid . expandChildren = true ;
@@ -144,7 +139,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
144139 const childGridLevel2 = childGridLevel1 . hgridAPI . getChildGrids ( false ) [ 0 ] ;
145140
146141 hierarchicalGrid . selectAllRows ( ) ;
147- childGridLevel1 . selectedRows ( [ '00' ] ) ;
142+ childGridLevel1 . selectRows ( [ '00' ] ) ;
148143 fix . detectChanges ( ) ;
149144
150145 // Change row selection for grids
@@ -493,7 +488,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
493488 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
494489
495490 // Click on a row
496- secondRow . nativeElement . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
491+ secondRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
497492 fix . detectChanges ( ) ;
498493
499494 GridSelectionFunctions . verifyRowSelected ( secondRow ) ;
@@ -503,7 +498,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
503498
504499 it ( 'should retain selected row when filtering' , ( ) => {
505500 const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) ;
506- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
501+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
507502 fix . detectChanges ( ) ;
508503
509504 hierarchicalGrid . filter ( 'ID' , '1' , IgxStringFilteringOperand . instance ( ) . condition ( 'doesNotContain' ) , true ) ;
@@ -513,7 +508,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
513508 GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
514509 } ) ;
515510
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' , ( ) => {
517512 rowIsland1 . rowSelection = GridSelectionMode . multiple ;
518513 fix . detectChanges ( ) ;
519514
@@ -567,7 +562,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
567562 firstRow . toggle ( ) ;
568563 fix . detectChanges ( ) ;
569564
570- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
565+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
571566 fix . detectChanges ( ) ;
572567
573568 GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
@@ -582,15 +577,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
582577 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
583578
584579 // Click on deleted row
585- UIInteractions . simulateClickEvent ( firstRow . nativeElement ) ;
580+ firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
586581 fix . detectChanges ( ) ;
587582
588583 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
589584 GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
590585 expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
591586
592587 // Click on checkbox for deleted row
593- GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
588+ firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
594589 fix . detectChanges ( ) ;
595590
596591 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -610,7 +605,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
610605 expect ( childGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
611606
612607 const childGridFirstRow = childGrid . getRowByIndex ( 0 ) ;
613- UIInteractions . simulateClickEvent ( childGridFirstRow . nativeElement , false , true ) ;
608+ childGridFirstRow . onClick ( UIInteractions . getMouseEvent ( 'click' , false , false , true ) ) ;
614609 fix . detectChanges ( ) ;
615610
616611 GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
@@ -684,7 +679,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
684679 } ) ) ;
685680
686681 it ( 'should deselect deleted row' , ( ) => {
687- GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
682+ hierarchicalGrid . onHeaderSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
688683 fix . detectChanges ( ) ;
689684
690685 GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
0 commit comments