@@ -4080,8 +4080,8 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
40804080 fix . detectChanges ( ) ;
40814081
40824082 verifyExcelStyleFilterAvailableOptions ( fix ,
4083- [ 'Select All' , '(Blanks)' , '0' , '20' , '100' , '127' , '254' ] ,
4084- [ true , true , true , true , true , true , true ] ) ;
4083+ [ 'Select All' , '(Blanks)' , '0' , '20' , '100' , '127' , '254' , '702' , '1,000' ] ,
4084+ [ true , true , true , true , true , true , true , true , true ] ) ;
40854085
40864086 GridFunctions . clickExcelFilterIcon ( fix , 'ProductName' ) ;
40874087 tick ( 100 ) ;
@@ -4870,33 +4870,27 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
48704870 const column = grid . getColumnByName ( 'AnotherField' ) ;
48714871 expect ( column . filteringIgnoreCase ) . toBeTrue ( ) ;
48724872
4873- GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'AnotherField' ) ;
4873+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
48744874 tick ( 100 ) ;
48754875 fix . detectChanges ( ) ;
48764876
4877- const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4878- const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4879-
4880- expect ( listItems . length ) . toBe ( 3 , 'incorrect rendered list items count' ) ;
4881- expect ( listItems [ 1 ] . innerText ) . toBe ( 'Custom' , 'incorrect list item label' ) ;
4877+ verifyExcelStyleFilterAvailableOptions ( fix ,
4878+ [ 'Select All' , 'a' , 'Custom' ] ,
4879+ [ true , true , true ] ) ;
48824880 } ) ) ;
48834881
48844882 it ( 'Should not ignore duplicate records when column\'\s filteringIgnoreCase is false' , fakeAsync ( ( ) => {
48854883 const column = grid . getColumnByName ( 'AnotherField' ) ;
48864884 column . filteringIgnoreCase = false ;
48874885 expect ( column . filteringIgnoreCase ) . toBeFalse ( ) ;
48884886
4889- GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'AnotherField' ) ;
4887+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
48904888 tick ( 100 ) ;
48914889 fix . detectChanges ( ) ;
48924890
4893- const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4894- const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4895-
4896- expect ( listItems . length ) . toBe ( 5 , 'incorrect rendered list items count' ) ;
4897- expect ( listItems [ 1 ] . innerText ) . toBe ( 'Custom' , 'incorrect list item label' ) ;
4898- expect ( listItems [ 3 ] . innerText ) . toBe ( 'custoM' , 'incorrect list item label' ) ;
4899- expect ( listItems [ 4 ] . innerText ) . toBe ( 'custom' , 'incorrect list item label' ) ;
4891+ verifyExcelStyleFilterAvailableOptions ( fix ,
4892+ [ 'Select All' , 'a' , 'Custom' , 'custoM' , 'custom' ] ,
4893+ [ true , true , true , true , true ] ) ;
49004894 } ) ) ;
49014895
49024896 it ( 'Should display "Add to current filter selection" button on typing in input' , fakeAsync ( ( ) => {
@@ -5269,6 +5263,53 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
52695263 expect ( listItems [ 2 ] . innerText ) . toBe ( 'No' , 'incorrect list item label' ) ;
52705264 expect ( listItems [ 3 ] . innerText ) . toBe ( 'Yes' , 'incorrect list item label' ) ;
52715265 } ) ) ;
5266+
5267+ it ( 'Should sort items in excel style search correctly' , fakeAsync ( ( ) => {
5268+ const data = [
5269+ {
5270+ Downloads : 254 ,
5271+ ID : 1 ,
5272+ ProductName : 'Ignite UI for JavaScript' ,
5273+ ReleaseDate : null ,
5274+ ReleaseDateTime : null ,
5275+ ReleaseTime : new Date ( 2010 , 4 , 27 , 23 , 0 , 0 ) ,
5276+ Released : false ,
5277+ AnotherField : 'BWord'
5278+ } ,
5279+ {
5280+ Downloads : 127 ,
5281+ ID : 2 ,
5282+ ProductName : 'NetAdvantage' ,
5283+ ReleaseDate : null ,
5284+ ReleaseDateTime : null ,
5285+ ReleaseTime : new Date ( 2021 , 4 , 27 , 1 , 0 , 0 ) ,
5286+ Released : true ,
5287+ AnotherField : 'bWord'
5288+ } ,
5289+ {
5290+ Downloads : 20 ,
5291+ ID : 3 ,
5292+ ProductName : 'Ignite UI for Angular' ,
5293+ ReleaseDate : null ,
5294+ ReleaseDateTime : null ,
5295+ ReleaseTime : new Date ( 2015 , 4 , 27 , 12 , 0 , 0 ) ,
5296+ Released : null ,
5297+ AnotherField : 'aWord'
5298+ }
5299+ ] ;
5300+ fix . componentInstance . data = data ;
5301+ fix . detectChanges ( ) ;
5302+
5303+ // Open excel style custom filtering dialog for string column
5304+ GridFunctions . clickExcelFilterIcon ( fix , 'AnotherField' ) ;
5305+ tick ( 100 ) ;
5306+ fix . detectChanges ( ) ;
5307+
5308+ // Verify items order is case INsensitive
5309+ verifyExcelStyleFilterAvailableOptions ( fix ,
5310+ [ 'Select All' , 'aWord' , 'BWord' ] ,
5311+ [ true , true , true ] ) ;
5312+ } ) ) ;
52725313 } ) ;
52735314
52745315 describe ( 'Templates: ' , ( ) => {
@@ -5743,7 +5784,6 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
57435784
57445785 tick ( 1050 ) ;
57455786 fix . detectChanges ( ) ;
5746-
57475787 } ) ) ;
57485788
57495789 it ( 'Done callback should be executed only once per column' , fakeAsync ( ( ) => {
@@ -6321,6 +6361,7 @@ const verifyExcelStyleFilterAvailableOptions = (fix, labels: string[], checked:
63216361 const labelElements : any [ ] = Array . from ( GridFunctions . getExcelStyleSearchComponentListItems ( fix , excelMenu ) ) ;
63226362 const checkboxElements : any [ ] = Array . from ( GridFunctions . getExcelStyleFilteringCheckboxes ( fix , excelMenu ) ) ;
63236363
6364+ expect ( labelElements . length ) . toBe ( labels . length , 'incorrect rendered list items count' ) ;
63246365 expect ( labelElements . length ) . toBeGreaterThan ( 2 ) ;
63256366 expect ( checkboxElements . length ) . toBeGreaterThan ( 2 ) ;
63266367 labels . forEach ( ( l , index ) => {
0 commit comments