@@ -4013,8 +4013,8 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
40134013 fix . detectChanges ( ) ;
40144014
40154015 verifyExcelStyleFilterAvailableOptions ( fix ,
4016- [ 'Select All' , '(Blanks)' , '0' , '20' , '100' , '127' , '254' ] ,
4017- [ true , true , true , true , true , true , true ] ) ;
4016+ [ 'Select All' , '(Blanks)' , '0' , '20' , '100' , '127' , '254' , '702' , '1,000' ] ,
4017+ [ true , true , true , true , true , true , true , true , true ] ) ;
40184018
40194019 GridFunctions . clickExcelFilterIcon ( fix , 'ProductName' ) ;
40204020 tick ( 100 ) ;
@@ -4803,33 +4803,27 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
48034803 const column = grid . getColumnByName ( 'AnotherField' ) ;
48044804 expect ( column . filteringIgnoreCase ) . toBeTrue ( ) ;
48054805
4806- GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'AnotherField' ) ;
4806+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
48074807 tick ( 100 ) ;
48084808 fix . detectChanges ( ) ;
48094809
4810- const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4811- const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4812-
4813- expect ( listItems . length ) . toBe ( 3 , 'incorrect rendered list items count' ) ;
4814- expect ( listItems [ 1 ] . innerText ) . toBe ( 'Custom' , 'incorrect list item label' ) ;
4810+ verifyExcelStyleFilterAvailableOptions ( fix ,
4811+ [ 'Select All' , 'a' , 'Custom' ] ,
4812+ [ true , true , true ] ) ;
48154813 } ) ) ;
48164814
48174815 it ( 'Should not ignore duplicate records when column\'\s filteringIgnoreCase is false' , fakeAsync ( ( ) => {
48184816 const column = grid . getColumnByName ( 'AnotherField' ) ;
48194817 column . filteringIgnoreCase = false ;
48204818 expect ( column . filteringIgnoreCase ) . toBeFalse ( ) ;
48214819
4822- GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'AnotherField' ) ;
4820+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
48234821 tick ( 100 ) ;
48244822 fix . detectChanges ( ) ;
48254823
4826- const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4827- const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4828-
4829- expect ( listItems . length ) . toBe ( 5 , 'incorrect rendered list items count' ) ;
4830- expect ( listItems [ 1 ] . innerText ) . toBe ( 'Custom' , 'incorrect list item label' ) ;
4831- expect ( listItems [ 3 ] . innerText ) . toBe ( 'custoM' , 'incorrect list item label' ) ;
4832- expect ( listItems [ 4 ] . innerText ) . toBe ( 'custom' , 'incorrect list item label' ) ;
4824+ verifyExcelStyleFilterAvailableOptions ( fix ,
4825+ [ 'Select All' , 'a' , 'Custom' , 'custoM' , 'custom' ] ,
4826+ [ true , true , true , true , true ] ) ;
48334827 } ) ) ;
48344828
48354829 it ( 'Should display "Add to current filter selection" button on typing in input' , fakeAsync ( ( ) => {
@@ -5158,6 +5152,47 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
51585152 expect ( listItems [ 2 ] . innerText ) . toBe ( 'No' , 'incorrect list item label' ) ;
51595153 expect ( listItems [ 3 ] . innerText ) . toBe ( 'Yes' , 'incorrect list item label' ) ;
51605154 } ) ) ;
5155+
5156+ it ( 'Should sort items in excel style search correctly' , fakeAsync ( ( ) => {
5157+ const data = [
5158+ {
5159+ Downloads : 254 ,
5160+ ID : 1 ,
5161+ ProductName : 'Ignite UI for JavaScript' ,
5162+ ReleaseDate : null ,
5163+ Released : false ,
5164+ AnotherField : 'BWord'
5165+ } ,
5166+ {
5167+ Downloads : 127 ,
5168+ ID : 2 ,
5169+ ProductName : 'NetAdvantage' ,
5170+ ReleaseDate : null ,
5171+ Released : true ,
5172+ AnotherField : 'bWord'
5173+ } ,
5174+ {
5175+ Downloads : 20 ,
5176+ ID : 3 ,
5177+ ProductName : 'Ignite UI for Angular' ,
5178+ ReleaseDate : null ,
5179+ Released : null ,
5180+ AnotherField : 'aWord'
5181+ }
5182+ ] ;
5183+ fix . componentInstance . data = data ;
5184+ fix . detectChanges ( ) ;
5185+
5186+ // Open excel style custom filtering dialog for string column
5187+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
5188+ tick ( 100 ) ;
5189+ fix . detectChanges ( ) ;
5190+
5191+ // Verify items order is case INsensitive
5192+ verifyExcelStyleFilterAvailableOptions ( fix ,
5193+ [ 'Select All' , 'aWord' , 'BWord' ] ,
5194+ [ true , true , true ] ) ;
5195+ } ) ) ;
51615196 } ) ;
51625197
51635198 describe ( 'Templates: ' , ( ) => {
@@ -5623,7 +5658,6 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
56235658
56245659 tick ( 1050 ) ;
56255660 fix . detectChanges ( ) ;
5626-
56275661 } ) ) ;
56285662
56295663 it ( 'Done callback should be executed only once per column' , fakeAsync ( ( ) => {
@@ -6202,6 +6236,7 @@ function verifyExcelStyleFilterAvailableOptions(fix, labels: string[], checked:
62026236 const labelElements : any [ ] = Array . from ( GridFunctions . getExcelStyleSearchComponentListItems ( fix , excelMenu ) ) ;
62036237 const checkboxElements : any [ ] = Array . from ( GridFunctions . getExcelStyleFilteringCheckboxes ( fix , excelMenu ) ) ;
62046238
6239+ expect ( labelElements . length ) . toBe ( labels . length , 'incorrect rendered list items count' ) ;
62056240 expect ( labelElements . length ) . toBeGreaterThan ( 2 ) ;
62066241 expect ( checkboxElements . length ) . toBeGreaterThan ( 2 ) ;
62076242 labels . forEach ( ( l , index ) => {
0 commit comments