@@ -56,42 +56,19 @@ describe('useColumnSorting', () => {
5656 } ) ;
5757
5858 describe ( 'when only the current column is being sorted' , ( ) => {
59- describe ( 'when the header cell has no actions' , ( ) => {
60- it ( 'renders aria-sort but not sortingScreenReaderText' , ( ) => {
61- const { ariaSort, sortingScreenReaderText } = renderHook ( ( ) =>
62- useColumnSorting ( {
63- ...mockSortingArgs ,
64- sorting : {
65- onSort,
66- columns : [ { id : columnId , direction : 'asc' } ] ,
67- } ,
68- hasColumnActions : false ,
69- } )
70- ) . result . current ;
71-
72- expect ( ariaSort ) . toEqual ( 'ascending' ) ;
73- expect ( getRender ( sortingScreenReaderText ) ) . toHaveTextContent ( '' ) ;
74- } ) ;
75- } ) ;
76-
77- describe ( 'when the header cell has actions' , ( ) => {
78- it ( 'renders aria-sort and sortingScreenReaderText' , ( ) => {
79- const { ariaSort, sortingScreenReaderText } = renderHook ( ( ) =>
80- useColumnSorting ( {
81- ...mockSortingArgs ,
82- sorting : {
83- onSort,
84- columns : [ { id : columnId , direction : 'desc' } ] ,
85- } ,
86- hasColumnActions : true ,
87- } )
88- ) . result . current ;
89-
90- expect ( ariaSort ) . toEqual ( 'descending' ) ;
91- expect ( getRender ( sortingScreenReaderText ) ) . toHaveTextContent (
92- 'Sorted descending.'
93- ) ;
94- } ) ;
59+ it ( 'renders aria-sort but not sortingScreenReaderText' , ( ) => {
60+ const { ariaSort, sortingScreenReaderText } = renderHook ( ( ) =>
61+ useColumnSorting ( {
62+ ...mockSortingArgs ,
63+ sorting : {
64+ onSort,
65+ columns : [ { id : columnId , direction : 'asc' } ] ,
66+ } ,
67+ } )
68+ ) . result . current ;
69+
70+ expect ( ariaSort ) . toEqual ( 'ascending' ) ;
71+ expect ( getRender ( sortingScreenReaderText ) ) . toHaveTextContent ( '' ) ;
9572 } ) ;
9673 } ) ;
9774 } ) ;
0 commit comments