@@ -14,7 +14,6 @@ import {
14
14
IgxHierarchicalGridRowSelectionNoTransactionsComponent
15
15
} from '../../test-utils/hierarhical-grid-components.spec' ;
16
16
import { IgxRowSelectorsModule } from '../igx-row-selectors.module' ;
17
- import { HelperUtils } from '../../test-utils/helper-utils.spec' ;
18
17
import { GridSelectionFunctions } from '../../test-utils/grid-functions.spec' ;
19
18
import { GridSelectionMode } from '../common/enums' ;
20
19
@@ -742,7 +741,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
742
741
} ) ;
743
742
} ) ;
744
743
745
- describe ( 'Custom selectors' , ( ) => {
744
+ describe ( 'Custom row selectors' , ( ) => {
746
745
let hGrid ;
747
746
let firstLevelChild ;
748
747
@@ -757,109 +756,109 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
757
756
it ( 'Row context `select` method selects a single row' , ( ) => {
758
757
// root grid
759
758
const firstRootRow = hGrid . getRowByIndex ( 0 ) ;
760
- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
759
+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
761
760
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 ) ;
764
763
765
764
// child grid
766
- HelperUtils . expandRowIsland ( 2 ) ;
765
+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
767
766
fix . detectChanges ( ) ;
768
767
769
768
const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
770
769
const childRow = childGrid . getRowByIndex ( 0 ) ;
771
- HelperUtils . rowCheckboxClick ( childRow ) ;
770
+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
772
771
fix . detectChanges ( ) ;
773
772
774
- HelperUtils . verifyRowSelected ( childRow ) ;
775
- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
773
+ GridSelectionFunctions . verifyRowSelected ( childRow ) ;
774
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
776
775
} ) ;
777
776
778
- it ( 'Row context `deselect` method deselects an already selected row' , ( ) => {
777
+ it ( 'Row context `deselect` method deselects an already selected row' , fakeAsync ( ( ) => {
779
778
// root grid
780
779
const firstRootRow = hGrid . getRowByIndex ( 1 ) ;
781
- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
780
+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
782
781
fix . detectChanges ( ) ;
783
- HelperUtils . verifyRowSelected ( firstRootRow ) ;
784
- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , true ) ;
782
+ GridSelectionFunctions . verifyRowSelected ( firstRootRow ) ;
783
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , true ) ;
785
784
786
- HelperUtils . rowCheckboxClick ( firstRootRow ) ;
785
+ GridSelectionFunctions . clickRowCheckbox ( firstRootRow ) ;
787
786
fix . detectChanges ( ) ;
788
- HelperUtils . verifyRowSelected ( firstRootRow , false ) ;
789
- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
787
+ GridSelectionFunctions . verifyRowSelected ( firstRootRow , false ) ;
788
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
790
789
791
790
// child grid
792
- HelperUtils . expandRowIsland ( 2 ) ;
791
+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
793
792
fix . detectChanges ( ) ;
794
793
795
794
const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
796
795
const childRow = childGrid . getRowByIndex ( 0 ) ;
797
796
798
- HelperUtils . rowCheckboxClick ( childRow ) ;
797
+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
799
798
fix . detectChanges ( ) ;
800
- HelperUtils . verifyRowSelected ( childRow ) ;
801
- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
799
+ GridSelectionFunctions . verifyRowSelected ( childRow ) ;
800
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , true ) ;
802
801
803
- HelperUtils . rowCheckboxClick ( childRow ) ;
802
+ GridSelectionFunctions . clickRowCheckbox ( childRow ) ;
804
803
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
+ } ) ) ;
808
807
809
808
it ( 'Header context `selectAll` method selects all rows' , ( ) => {
810
809
// root grid
811
- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
810
+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
812
811
fix . detectChanges ( ) ;
813
- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
812
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
814
813
expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
815
814
816
815
// child grid
817
- HelperUtils . expandRowIsland ( 2 ) ;
816
+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
818
817
fix . detectChanges ( ) ;
819
818
820
819
const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
821
- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
820
+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
822
821
fix . detectChanges ( ) ;
823
822
824
823
expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
825
824
} ) ;
826
825
827
826
it ( 'Header context `deselectAll` method deselects all rows' , ( ) => {
828
827
// root grid
829
- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
828
+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
830
829
fix . detectChanges ( ) ;
831
- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
830
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , true , false ) ;
832
831
expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
833
832
834
- HelperUtils . clickHeaderRowCheckbox ( hGrid ) ;
833
+ GridSelectionFunctions . clickHeaderRowCheckbox ( hGrid ) ;
835
834
fix . detectChanges ( ) ;
836
- HelperUtils . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
835
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( hGrid , false , false ) ;
837
836
expect ( hGrid . selectionService . areAllRowSelected ( ) ) . toBeFalsy ( ) ;
838
837
839
838
// child grid
840
- HelperUtils . expandRowIsland ( 2 ) ;
839
+ GridSelectionFunctions . expandRowIsland ( 2 ) ;
841
840
fix . detectChanges ( ) ;
842
841
843
842
const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
844
843
845
- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
844
+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
846
845
fix . detectChanges ( ) ;
847
- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , true , false ) ;
846
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , true , false ) ;
848
847
expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeTruthy ( ) ;
849
848
850
- HelperUtils . clickHeaderRowCheckbox ( childGrid ) ;
849
+ GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid ) ;
851
850
fix . detectChanges ( ) ;
852
- HelperUtils . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
851
+ GridSelectionFunctions . verifyHeaderRowCheckboxState ( childGrid , false , false ) ;
853
852
expect ( childGrid . selectionService . areAllRowSelected ( ) ) . toBeFalsy ( ) ;
854
853
} ) ;
855
854
856
855
it ( 'Should have the correct properties in the custom row selector header template context' , ( ) => {
857
856
spyOn ( fix . componentInstance , 'handleHeadSelectorClick' ) . and . callThrough ( ) ;
858
857
859
- HelperUtils . headerCheckboxClick ( hGrid ) ;
858
+ GridSelectionFunctions . headerCheckboxClick ( hGrid ) ;
860
859
fix . detectChanges ( ) ;
861
860
862
- expect ( fix . componentInstance . handleHeadSelectorClick ) . toHaveBeenCalledWith ( new MouseEvent ( 'click' ) , {
861
+ expect ( fix . componentInstance . handleHeadSelectorClick ) . toHaveBeenCalledWith ( {
863
862
selectedCount : 0 ,
864
863
totalCount : hGrid . data . length ,
865
864
selectAll : jasmine . anything ( ) ,
@@ -870,10 +869,10 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
870
869
it ( 'Should have the correct properties in the custom row selector template context' , ( ) => {
871
870
spyOn ( fix . componentInstance , 'handleRowSelectorClick' ) . and . callThrough ( ) ;
872
871
873
- HelperUtils . rowCheckboxClick ( hGrid . getRowByIndex ( 1 ) ) ;
872
+ GridSelectionFunctions . rowCheckboxClick ( hGrid . getRowByIndex ( 1 ) ) ;
874
873
fix . detectChanges ( ) ;
875
874
876
- expect ( fix . componentInstance . handleRowSelectorClick ) . toHaveBeenCalledWith ( new MouseEvent ( 'click' ) , {
875
+ expect ( fix . componentInstance . handleRowSelectorClick ) . toHaveBeenCalledWith ( {
877
876
index : 1 ,
878
877
rowID : '1' ,
879
878
selected : false ,
@@ -889,7 +888,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
889
888
expect ( hGrid . getRowByIndex ( 0 ) . nativeElement . querySelector ( '.rowNumber' ) . textContent ) . toEqual ( '15' ) ;
890
889
891
890
// child grid
892
- HelperUtils . expandRowIsland ( 3 ) ;
891
+ GridSelectionFunctions . expandRowIsland ( 3 ) ;
893
892
fix . detectChanges ( ) ;
894
893
895
894
const childGrid = hGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
0 commit comments