Skip to content

Commit 25e146b

Browse files
chore(eui): update column sorting tests
1 parent 297ca09 commit 25e146b

1 file changed

Lines changed: 13 additions & 36 deletions

File tree

packages/eui/src/components/datagrid/body/header/column_sorting.test.tsx

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)