@@ -4403,40 +4403,27 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
44034403 tick ( 100 ) ;
44044404 } ) ) ;
44054405
4406- it ( 'Should filter, clear and enable/disable the apply button correctly.' , fakeAsync ( ( ) => {
4406+ it ( 'Should enable/disable the apply button correctly.' , fakeAsync ( ( ) => {
44074407 GridFunctions . clickExcelFilterIcon ( fix , 'ProductName' ) ;
44084408 tick ( 100 ) ;
44094409 fix . detectChanges ( ) ;
44104410
4411- // Type string in search box .
4411+ // Verify there are filtered- in results and that apply button is enabled .
44124412 const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4413- const inputNativeElement = searchComponent . querySelector ( '.igx-input-group__input' ) ;
4414- sendInputNativeElement ( inputNativeElement , 'hello there' , fix ) ;
4415- tick ( 100 ) ;
4416- fix . detectChanges ( ) ;
4417-
4418- // Verify there are no filtered-in results and that apply button is disabled.
4419- let listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
4420- let excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4421- let raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
4413+ const listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
4414+ const excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4415+ const raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
44224416 let applyButton : any = raisedButtons . find ( ( rb : any ) => rb . innerText === 'apply' ) ;
4423- expect ( listItems . length ) . toBe ( 0 , 'ESF search result should be empty' ) ;
4424- expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( true ) ;
4417+ expect ( listItems . length ) . toBe ( 6 , 'ESF search result should NOT be empty' ) ;
4418+ expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( false ) ;
44254419
4426- // Clear filtering.
4427- const icons = Array . from ( searchComponent . querySelectorAll ( 'igx-icon' ) ) ;
4428- const clearIcon : any = icons . find ( ( ic : any ) => ic . innerText === 'clear' ) ;
4429- clearIcon . click ( ) ;
4430- tick ( 100 ) ;
4420+ // Verify the apply button is disabled when all items are unchecked (when unchecking 'Select All').
4421+ const checkbox = excelMenu . querySelectorAll ( '.igx-checkbox__input' ) ;
4422+ checkbox [ 0 ] . click ( ) ; // Select All
4423+ tick ( ) ;
44314424 fix . detectChanges ( ) ;
4432-
4433- // Verify there are filtered-in results and that apply button is enabled.
4434- listItems = searchComponent . querySelectorAll ( 'igx-list-item' ) ;
4435- excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4436- raisedButtons = Array . from ( excelMenu . querySelectorAll ( '.igx-button--raised' ) ) ;
44374425 applyButton = raisedButtons . find ( ( rb : any ) => rb . innerText === 'apply' ) ;
4438- expect ( listItems . length ) . toBe ( 6 , 'ESF search result should NOT be empty' ) ;
4439- expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( false ) ;
4426+ expect ( applyButton . classList . contains ( 'igx-button--disabled' ) ) . toBe ( true ) ;
44404427 } ) ) ;
44414428
44424429 it ( 'display density is properly applied on the excel style filtering component' , fakeAsync ( ( ) => {
0 commit comments