@@ -3442,6 +3442,37 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
3442
3442
expect ( grid . filteredData ) . toBeNull ( ) ;
3443
3443
} ) ) ;
3444
3444
3445
+ it ( 'Should set the \'aria-disabled\' attribute for the ESF dialog clear filter button element with role=\'menuitem\'.' , fakeAsync ( ( ) => {
3446
+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
3447
+ expect ( grid . filteredData ) . toBeNull ( ) ;
3448
+ let clearFilterButtonMenuTiemRole = GridFunctions . getClearFilterInExcelStyleFiltering ( fix ) ;
3449
+ expect ( clearFilterButtonMenuTiemRole . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
3450
+
3451
+ const gridFilteringExpressionsTree = new FilteringExpressionsTree ( FilteringLogic . And ) ;
3452
+ const columnsFilteringTree = new FilteringExpressionsTree ( FilteringLogic . Or , 'ProductName' ) ;
3453
+ columnsFilteringTree . filteringOperands = [
3454
+ { fieldName : 'ProductName' , searchVal : 'Angular' , condition : IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) } ,
3455
+ { fieldName : 'ProductName' , searchVal : 'Ignite' , condition : IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) }
3456
+ ] ;
3457
+ gridFilteringExpressionsTree . filteringOperands . push ( columnsFilteringTree ) ;
3458
+ grid . filteringExpressionsTree = gridFilteringExpressionsTree ;
3459
+ fix . detectChanges ( ) ;
3460
+
3461
+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'ProductName' ) ;
3462
+ expect ( grid . filteredData . length ) . toEqual ( 2 ) ;
3463
+ clearFilterButtonMenuTiemRole = GridFunctions . getClearFilterInExcelStyleFiltering ( fix ) ;
3464
+ expect ( clearFilterButtonMenuTiemRole . getAttribute ( 'aria-disabled' ) ) . toBe ( 'false' ) ;
3465
+
3466
+ const clearFilterButton = GridFunctions . getClearFilterInExcelStyleFiltering ( fix ) ;
3467
+ clearFilterButton . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Enter' , bubbles : true } ) ) ;
3468
+ tick ( 100 ) ;
3469
+ fix . detectChanges ( ) ;
3470
+
3471
+ expect ( grid . filteredData ) . toBeNull ( ) ;
3472
+ clearFilterButtonMenuTiemRole = GridFunctions . getClearFilterInExcelStyleFiltering ( fix ) ;
3473
+ expect ( clearFilterButtonMenuTiemRole . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
3474
+ } ) ) ;
3475
+
3445
3476
it ( 'Should update filter icon when dialog is closed and the filter has been changed.' , fakeAsync ( ( ) => {
3446
3477
GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
3447
3478
0 commit comments