@@ -370,6 +370,11 @@ describe('HeaderCell', () => {
370370 } ) ;
371371 } ) ;
372372 } ) ;
373+
374+ it ( 'should not have aria-label' , ( ) => {
375+ wrapper = shallow ( < HeaderCell column = { column } index = { index } /> ) ;
376+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBeUndefined ( ) ;
377+ } ) ;
373378 } ) ;
374379
375380 describe ( 'when column.sort is enable' , ( ) => {
@@ -413,11 +418,20 @@ describe('HeaderCell', () => {
413418 expect ( onSortCallBack . callCount ) . toBe ( 0 ) ;
414419 } ) ;
415420
421+ it ( 'should have aria-label' , ( ) => {
422+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( 'ID sortable' ) ;
423+ } ) ;
424+
425+
416426 describe ( 'and sorting prop is false' , ( ) => {
417427 it ( 'header should render SortSymbol as default' , ( ) => {
418428 expect ( wrapper . find ( SortSymbol ) . length ) . toBe ( 1 ) ;
419429 } ) ;
420430
431+ it ( 'should describe column header as sortable' , ( ) => {
432+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( 'ID sortable' ) ;
433+ } ) ;
434+
421435 describe ( 'when sortCaret is defined ' , ( ) => {
422436 beforeEach ( ( ) => {
423437 column = { ...column , sortCaret : jest . fn ( ) } ;
@@ -445,6 +459,10 @@ describe('HeaderCell', () => {
445459 < HeaderCell column = { column } index = { index } sortOrder = { order } sorting /> ) ;
446460 } ) ;
447461
462+ it ( 'should describe sort order in aria-label' , ( ) => {
463+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( `ID sort ${ order } ` ) ;
464+ } ) ;
465+
448466 it ( 'should render SortCaret correctly' , ( ) => {
449467 expect ( wrapper . find ( SortCaret ) . length ) . toBe ( 1 ) ;
450468 expect ( wrapper . find ( SortCaret ) . prop ( 'order' ) ) . toEqual ( order ) ;
0 commit comments