@@ -4369,6 +4369,49 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
43694369 expect ( listItems [ 3 ] . innerText ) . toBe ( 'custoM' , 'incorrect list item label' ) ;
43704370 expect ( listItems [ 4 ] . innerText ) . toBe ( 'custom' , 'incorrect list item label' ) ;
43714371 } ) ) ;
4372+
4373+ it ( 'Should clear search criteria when selecting clear column filters option.' , fakeAsync ( ( ) => {
4374+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4375+
4376+ let checkboxes : any = Array . from ( GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ) ;
4377+
4378+ tick ( 100 ) ;
4379+ fix . detectChanges ( ) ;
4380+
4381+ checkboxes [ 0 ] . click ( ) ;
4382+ tick ( ) ;
4383+ fix . detectChanges ( ) ;
4384+
4385+ checkboxes [ 2 ] . click ( ) ;
4386+ tick ( ) ;
4387+ fix . detectChanges ( ) ;
4388+
4389+ GridFunctions . clickApplyExcelStyleFiltering ( fix ) ;
4390+ tick ( 100 ) ;
4391+ fix . detectChanges ( ) ;
4392+
4393+ expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4394+
4395+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
4396+
4397+ let inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4398+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , 'Net' , fix ) ;
4399+
4400+ const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix ) ;
4401+ expect ( listItems . length ) . toBe ( 2 , 'incorrect rendered list items count' ) ;
4402+
4403+ GridFunctions . clickClearFilterInExcelStyleFiltering ( fix ) ;
4404+ fix . detectChanges ( ) ;
4405+ flush ( ) ;
4406+
4407+ expect ( grid . filteredData ) . toBeNull ( ) ;
4408+
4409+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix ) ;
4410+ expect ( inputNativeElement . value ) . toBe ( '' , 'search criteria is not cleared' ) ;
4411+
4412+ checkboxes = Array . from ( GridFunctions . getExcelStyleFilteringCheckboxes ( fix ) ) ;
4413+ expect ( checkboxes . every ( ch => ch . checked ) ) . toBeTrue ( ) ;
4414+ } ) ) ;
43724415 } ) ;
43734416
43744417 describe ( null , ( ) => {
@@ -4627,7 +4670,6 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
46274670 GridSelectionFunctions . verifyColumnAndCellsSelected ( columnId , false ) ;
46284671
46294672 } ) ;
4630-
46314673 } ) ;
46324674} ) ;
46334675
0 commit comments