@@ -14,7 +14,6 @@ import {
1414 IgxHierarchicalGridRowSelectionNoTransactionsComponent
1515} from '../../test-utils/hierarhical-grid-components.spec' ;
1616import { IgxRowSelectorsModule } from '../igx-row-selectors.module' ;
17- import { HelperUtils } from '../../test-utils/helper-utils.spec' ;
1817import { GridSelectionFunctions } from '../../test-utils/grid-functions.spec' ;
1918import { GridSelectionMode } from '../common/enums' ;
2019
@@ -757,109 +756,109 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
757756 it ( 'Row context `select` method selects a single row' , ( ) => {
758757 // root grid
759758 const firstRootRow = hGrid . getRowByIndex ( 0 ) ;
760- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
759+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
761760 fix . detectChanges ( ) ;
762- HelperUtils . verifyRowSelected ( hGrid . getRowByIndex ( 0 ) ) ;
763- HelperUtils . verifyHeaderRowCheckboxState ( fix , false , true ) ;
761+ GridSelectionFunctions . verifyRowSelected ( hGrid . getRowByIndex ( 0 ) ) ;
762+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
764763
765764 // child grid
766- HelperUtils . expandRowIsland ( 2 ) ;
765+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
767766 fix . detectChanges ( ) ;
768767
769768 const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
770769 const childRow = childGrid . getRowByIndex ( 0 ) ;
771- HelperUtils . rowCheckboxClick ( childRow ) ;
770+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
772771 fix . detectChanges ( ) ;
773772
774- HelperUtils . verifyRowSelected ( childRow ) ;
775- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
773+ GridSelectionFunctions . verifyRowSelected ( childRow ) ;
774+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
776775 } ) ;
777776
778- it ( 'Row context `deselect` method deselects an already selected row' , ( ) => {
777+ it ( 'Row context `deselect` method deselects an already selected row' , fakeAsync ( ( ) => {
779778 // root grid
780779 const firstRootRow = hGrid . getRowByIndex ( 1 ) ;
781- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
780+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
782781 fix . detectChanges ( ) ;
783- HelperUtils . verifyRowSelected ( firstRootRow ) ;
784- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , true ) ;
782+ GridSelectionFunctions . verifyRowSelected ( firstRootRow ) ;
783+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , true ) ;
785784
786- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
785+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
787786 fix . detectChanges ( ) ;
788- HelperUtils . verifyRowSelected ( firstRootRow , false ) ;
789- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
787+ GridSelectionFunctions . verifyRowSelected ( firstRootRow , false ) ;
788+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
790789
791790 // child grid
792- HelperUtils . expandRowIsland ( 2 ) ;
791+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
793792 fix . detectChanges ( ) ;
794793
795794 const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
796795 const childRow = childGrid . getRowByIndex ( 0 ) ;
797796
798- HelperUtils . rowCheckboxClick ( childRow ) ;
797+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
799798 fix . detectChanges ( ) ;
800- HelperUtils . verifyRowSelected ( childRow ) ;
801- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
799+ GridSelectionFunctions . verifyRowSelected ( childRow ) ;
800+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
802801
803- HelperUtils . rowCheckboxClick ( childRow ) ;
802+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
804803 fix . detectChanges ( ) ;
805- HelperUtils . verifyRowSelected ( childRow , false ) ;
806- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
807- } ) ;
804+ GridSelectionFunctions . verifyRowSelected ( childRow , false ) ;
805+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
806+ } ) ) ;
808807
809808 it ( 'Header context `selectAll` method selects all rows' , ( ) => {
810809 // root grid
811- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
810+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
812811 fix . detectChanges ( ) ;
813- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
812+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
814813 expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
815814
816815 // child grid
817- HelperUtils . expandRowIsland ( 2 ) ;
816+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
818817 fix . detectChanges ( ) ;
819818
820819 const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
821- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
820+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
822821 fix . detectChanges ( ) ;
823822
824823 expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
825824 } ) ;
826825
827826 it ( 'Header context `deselectAll` method deselects all rows' , ( ) => {
828827 // root grid
829- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
828+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
830829 fix . detectChanges ( ) ;
831- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
830+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
832831 expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
833832
834- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
833+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
835834 fix . detectChanges ( ) ;
836- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
835+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
837836 expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeFalsy ( ) ;
838837
839838 // child grid
840- HelperUtils . expandRowIsland ( 2 ) ;
839+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
841840 fix . detectChanges ( ) ;
842841
843842 const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
844843
845- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
844+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
846845 fix . detectChanges ( ) ;
847- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , true , false ) ;
846+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , true , false ) ;
848847 expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
849848
850- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
849+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
851850 fix . detectChanges ( ) ;
852- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
851+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
853852 expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeFalsy ( ) ;
854853 } ) ;
855854
856855 it ( 'Should have the correct properties in the custom row selector header template context' , ( ) => {
857856 spyOn ( fix . componentInstance , 'handleHeadSelectorClick' ) . and . callThrough ( ) ;
858857
859- HelperUtils . headerCheckboxClick ( hGrid ) ;
858+ GridSelectionFunctions . headerCheckboxClick ( hGrid ) ;
860859 fix . detectChanges ( ) ;
861860
862- expect ( fix . componentInstance . handleHeadSelectorClick ) . toHaveBeenCalledWith ( new MouseEvent ( 'click' ) , {
861+ expect ( fix . componentInstance . handleHeadSelectorClick ) . toHaveBeenCalledWith ( {
863862 selectedCount : 0 ,
864863 totalCount : hGrid . data . length ,
865864 selectAll : jasmine . anything ( ) ,
@@ -870,10 +869,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
870869 it ( 'Should have the correct properties in the custom row selector template context' , ( ) => {
871870 spyOn ( fix . componentInstance , 'handleRowSelectorClick' ) . and . callThrough ( ) ;
872871
873- HelperUtils . rowCheckboxClick ( hGrid . getRowByIndex ( 1 ) ) ;
872+ GridSelectionFunctions . rowCheckboxClick ( hGrid . getRowByIndex ( 1 ) ) ;
874873 fix . detectChanges ( ) ;
875874
876- expect ( fix . componentInstance . handleRowSelectorClick ) . toHaveBeenCalledWith ( new MouseEvent ( 'click' ) , {
875+ expect ( fix . componentInstance . handleRowSelectorClick ) . toHaveBeenCalledWith ( {
877876 index : 1 ,
878877 rowID : '1' ,
879878 selected : false ,
@@ -889,7 +888,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
889888 expect ( hGrid . getRowByIndex ( 0 ) . nativeElement . querySelector ( '.rowNumber' ) . textContent ) . toEqual ( '15' ) ;
890889
891890 // child grid
892- HelperUtils . expandRowIsland ( 3 ) ;
891+ GridSelectionFunctions . expandRowIsland ( 3 ) ;
893892 fix . detectChanges ( ) ;
894893
895894 const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
0 commit comments