@@ -16,6 +16,7 @@ import {
1616import { GridFunctions , GridSelectionFunctions } from '../../test-utils/grid-functions.spec' ;
1717import { DebugElement } from '@angular/core' ;
1818import { GridSelectionMode , FilterMode } from '../common/enums' ;
19+ import { IgxStringFilteringOperand } from '../../data-operations/filtering-condition' ;
1920
2021const DEBOUNCETIME = 30 ;
2122
@@ -1231,5 +1232,42 @@ describe('IgxGrid - Headers Keyboard navigation #grid', () => {
12311232
12321233 expect ( GridFunctions . getExcelStyleFilteringComponent ( fix ) ) . toBeNull ( ) ;
12331234 } ) ;
1235+
1236+ it ( 'MCH Grid with no data: should be able to navigate with arrow keys in the headers' , ( ) => {
1237+ grid . filter ( 'Country' , 'Bulgaria' , IgxStringFilteringOperand . instance ( ) . condition ( 'contains' ) , true ) ;
1238+ fix . detectChanges ( ) ;
1239+
1240+ expect ( grid . rowList . length ) . toBe ( 0 ) ;
1241+
1242+ let header = GridFunctions . getColumnGroupHeaderCell ( 'General Information' , fix ) ;
1243+ UIInteractions . simulateClickAndSelectEvent ( header ) ;
1244+ fix . detectChanges ( ) ;
1245+
1246+ GridFunctions . verifyHeaderIsFocused ( header ) ;
1247+
1248+ UIInteractions . triggerEventHandlerKeyDown ( 'ArrowRight' , gridHeader , false , false , true ) ;
1249+ fix . detectChanges ( ) ;
1250+
1251+ header = GridFunctions . getColumnGroupHeaderCell ( 'Address Information' , fix ) ;
1252+ GridFunctions . verifyHeaderIsFocused ( header ) ;
1253+
1254+ UIInteractions . triggerEventHandlerKeyDown ( 'ArrowDown' , gridHeader , false , false , false ) ;
1255+ fix . detectChanges ( ) ;
1256+
1257+ header = GridFunctions . getColumnHeader ( 'Region' , fix ) ;
1258+ GridFunctions . verifyHeaderIsFocused ( header . parent ) ;
1259+
1260+ UIInteractions . triggerEventHandlerKeyDown ( 'ArrowRight' , gridHeader , false , false , false ) ;
1261+ fix . detectChanges ( ) ;
1262+
1263+ header = GridFunctions . getColumnGroupHeaderCell ( 'Country Information' , fix ) ;
1264+ GridFunctions . verifyHeaderIsFocused ( header ) ;
1265+
1266+ UIInteractions . triggerEventHandlerKeyDown ( 'ArrowLeft' , gridHeader , false , false , true ) ;
1267+ fix . detectChanges ( ) ;
1268+
1269+ header = GridFunctions . getColumnHeader ( 'CompanyName' , fix ) ;
1270+ GridFunctions . verifyHeaderIsFocused ( header . parent ) ;
1271+ } ) ;
12341272 } ) ;
12351273} ) ;
0 commit comments