@@ -3210,40 +3210,27 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
32103210 tick ( 100 ) ;
32113211 } ) ) ;
32123212
3213- it ( 'Should filter, clear and enable/disable the apply button correctly.' , fakeAsync ( ( ) => {
3213+ it ( 'Should enable/disable the apply button correctly.' , fakeAsync ( ( ) => {
32143214 GridFunctions . clickExcelFilterIcon ( fix , 'ProductName' ) ;
32153215 tick ( 100 ) ;
32163216 fix . detectChanges ( ) ;
32173217
3218- // Type string in search box .
3218+ // Verify there are filtered- in results and that apply button is enabled .
32193219 const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
3220- const inputNativeElement = searchComponent . querySelector ( '.igx-input-group__input' ) ;
3221- sendInputNativeElement ( inputNativeElement , 'hello there' , fix ) ;
3222- tick ( 100 ) ;
3223- fix . detectChanges ( ) ;
3224-
3225- // Verify there are no filtered-in results and that apply button is disabled.
3226- let listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
3227- let excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
3228- let raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
3220+ const listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
3221+ const excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
3222+ const raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
32293223 let applyButton : any = raisedButtons . find ( ( rb : any ) => rb . innerText === 'apply' ) ;
3230- expect ( listItems . length ) . toBe ( 0 , 'ESF search result should be empty' ) ;
3231- expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( true ) ;
3224+ expect ( listItems . length ) . toBe ( 6 , 'ESF search result should NOT be empty' ) ;
3225+ expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( false ) ;
32323226
3233- // Clear filtering.
3234- const icons = Array . from ( searchComponent . querySelectorAll ( 'igx-icon' ) ) ;
3235- const clearIcon : any = icons . find ( ( ic : any ) => ic . innerText === 'clear' ) ;
3236- clearIcon . click ( ) ;
3237- tick ( 100 ) ;
3227+ // Verify the apply button is disabled when all items are unchecked (when unchecking 'Select All').
3228+ const checkbox = excelMenu . querySelectorAll ( '.igx-checkbox__input' ) ;
3229+ checkbox [ 0 ] . click ( ) ; // Select All
3230+ tick ( ) ;
32383231 fix . detectChanges ( ) ;
3239-
3240- // Verify there are filtered-in results and that apply button is enabled.
3241- listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
3242- excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
3243- raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
32443232 applyButton = raisedButtons . find ( ( rb : any ) => rb . innerText === 'apply' ) ;
3245- expect ( listItems . length ) . toBe ( 6 , 'ESF search result should NOT be empty' ) ;
3246- expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( false ) ;
3233+ expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( true ) ;
32473234 } ) ) ;
32483235
32493236 it ( 'display density is properly applied on the excel style filtering component' , fakeAsync ( ( ) => {
0 commit comments