@@ -908,6 +908,80 @@ describe('IgxGrid - Advanced Filtering #grid - ', () => {
908
908
expect ( GridFunctions . getAdvancedFilteringInitialAddGroupButtons ( fix ) . length ) . toBe ( 2 ) ;
909
909
} ) ) ;
910
910
911
+ it ( 'Should apply filters on Apply button click without prior Commit button click' , fakeAsync ( ( ) => {
912
+ grid . openAdvancedFilteringDialog ( ) ;
913
+ fix . detectChanges ( ) ;
914
+
915
+ GridFunctions . clickAdvancedFilteringInitialAddGroupButton ( fix , 0 ) ;
916
+ tick ( 100 ) ;
917
+ fix . detectChanges ( ) ;
918
+
919
+ selectColumnInEditModeExpression ( fix , 1 ) ; // Select 'ProductName' column.
920
+ selectOperatorInEditModeExpression ( fix , 2 ) ; // Select 'Starts With' operator.
921
+ const input = GridFunctions . getAdvancedFilteringValueInput ( fix ) . querySelector ( 'input' ) ;
922
+ UIInteractions . clickAndSendInputElementValue ( input , 'ign' , fix ) ; // Type filter value.
923
+
924
+ GridFunctions . clickAdvancedFilteringApplyButton ( fix ) ;
925
+ tick ( 100 ) ;
926
+ fix . detectChanges ( ) ;
927
+
928
+ // Verify the filter results.
929
+ expect ( grid . filteredData . length ) . toEqual ( 2 ) ;
930
+ expect ( grid . rowList . length ) . toBe ( 2 ) ;
931
+ expect ( GridFunctions . getCurrentCellFromGrid ( grid , 0 , 1 ) . value ) . toBe ( 'Ignite UI for JavaScript' ) ;
932
+ expect ( GridFunctions . getCurrentCellFromGrid ( grid , 1 , 1 ) . value ) . toBe ( 'Ignite UI for Angular' ) ;
933
+ } ) ) ;
934
+
935
+ it ( 'Should close the dialog on Apply button click if not all expression inputs are set' , fakeAsync ( ( ) => {
936
+ grid . openAdvancedFilteringDialog ( ) ;
937
+ fix . detectChanges ( ) ;
938
+
939
+ GridFunctions . clickAdvancedFilteringInitialAddGroupButton ( fix , 0 ) ;
940
+ tick ( 100 ) ;
941
+ fix . detectChanges ( ) ;
942
+
943
+ GridFunctions . clickAdvancedFilteringApplyButton ( fix ) ;
944
+ tick ( 100 ) ;
945
+ fix . detectChanges ( ) ;
946
+
947
+ // Verify the dialog is closed an no records are filtered
948
+ expect ( GridFunctions . getAdvancedFilteringComponent ( fix ) ) . toBeNull ( ) ;
949
+ expect ( grid . filteredData ) . toBe ( null ) ;
950
+
951
+ grid . openAdvancedFilteringDialog ( ) ;
952
+ fix . detectChanges ( ) ;
953
+
954
+ GridFunctions . clickAdvancedFilteringInitialAddGroupButton ( fix , 0 ) ;
955
+ tick ( 100 ) ;
956
+ fix . detectChanges ( ) ;
957
+
958
+ selectColumnInEditModeExpression ( fix , 1 ) ; // Select 'ProductName' column.
959
+
960
+ GridFunctions . clickAdvancedFilteringApplyButton ( fix ) ;
961
+ tick ( 100 ) ;
962
+ fix . detectChanges ( ) ;
963
+
964
+ expect ( GridFunctions . getAdvancedFilteringComponent ( fix ) ) . toBeNull ( ) ;
965
+ expect ( grid . filteredData ) . toBe ( null ) ;
966
+
967
+ grid . openAdvancedFilteringDialog ( ) ;
968
+ fix . detectChanges ( ) ;
969
+
970
+ GridFunctions . clickAdvancedFilteringInitialAddGroupButton ( fix , 0 ) ;
971
+ tick ( 100 ) ;
972
+ fix . detectChanges ( ) ;
973
+
974
+ selectColumnInEditModeExpression ( fix , 1 ) ; // Select 'ProductName' column.
975
+ selectOperatorInEditModeExpression ( fix , 2 ) ; // Select 'Starts With' operator.
976
+
977
+ GridFunctions . clickAdvancedFilteringApplyButton ( fix ) ;
978
+ tick ( 100 ) ;
979
+ fix . detectChanges ( ) ;
980
+
981
+ expect ( GridFunctions . getAdvancedFilteringComponent ( fix ) ) . toBeNull ( ) ;
982
+ expect ( grid . filteredData ) . toBe ( null ) ;
983
+ } ) ) ;
984
+
911
985
it ( 'Column dropdown should contain only filterable columns.' , fakeAsync ( ( ) => {
912
986
// Open Advanced Filtering dialog.
913
987
grid . openAdvancedFilteringDialog ( ) ;
0 commit comments