@@ -370,6 +370,11 @@ describe('HeaderCell', () => {
370
370
} ) ;
371
371
} ) ;
372
372
} ) ;
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
+ } ) ;
373
378
} ) ;
374
379
375
380
describe ( 'when column.sort is enable' , ( ) => {
@@ -413,11 +418,20 @@ describe('HeaderCell', () => {
413
418
expect ( onSortCallBack . callCount ) . toBe ( 0 ) ;
414
419
} ) ;
415
420
421
+ it ( 'should have aria-label' , ( ) => {
422
+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( 'ID sortable' ) ;
423
+ } ) ;
424
+
425
+
416
426
describe ( 'and sorting prop is false' , ( ) => {
417
427
it ( 'header should render SortSymbol as default' , ( ) => {
418
428
expect ( wrapper . find ( SortSymbol ) . length ) . toBe ( 1 ) ;
419
429
} ) ;
420
430
431
+ it ( 'should describe column header as sortable' , ( ) => {
432
+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( 'ID sortable' ) ;
433
+ } ) ;
434
+
421
435
describe ( 'when sortCaret is defined ' , ( ) => {
422
436
beforeEach ( ( ) => {
423
437
column = { ...column , sortCaret : jest . fn ( ) } ;
@@ -445,6 +459,10 @@ describe('HeaderCell', () => {
445
459
< HeaderCell column = { column } index = { index } sortOrder = { order } sorting /> ) ;
446
460
} ) ;
447
461
462
+ it ( 'should describe sort order in aria-label' , ( ) => {
463
+ expect ( wrapper . find ( 'th' ) . prop ( 'aria-label' ) ) . toBe ( `ID sort ${ order } ` ) ;
464
+ } ) ;
465
+
448
466
it ( 'should render SortCaret correctly' , ( ) => {
449
467
expect ( wrapper . find ( SortCaret ) . length ) . toBe ( 1 ) ;
450
468
expect ( wrapper . find ( SortCaret ) . prop ( 'order' ) ) . toEqual ( order ) ;
0 commit comments