Skip to content

Commit b5cb092

Browse files
test(table header): remove unnecessary params
1 parent 1ffb669 commit b5cb092

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

src/shared/components/Table/Headers/Header/__tests__/Header.test.tsx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
import { renderWithContainer } from 'shared/testsUtils';
22
import { screen, within } from 'shared/testsUtils/customRender';
33
import Header from '../Header';
4-
import { THeader } from '../type';
5-
6-
const defaultProps = {
7-
onSort: vi.fn(),
8-
};
94

105
const container = document.createElement('tr');
116

12-
const headerMock: THeader = {
13-
label: 'label',
14-
key: 'uid',
15-
field: 'name',
16-
};
17-
const sortingMock = {
18-
field: 'name',
19-
order: 1,
20-
};
21-
227
describe('Header', () => {
238
it.each`
24-
header | sorting | scope
25-
${headerMock} | ${undefined} | ${undefined}
26-
${headerMock} | ${sortingMock} | ${'col'}
27-
${headerMock} | ${undefined} | ${'row'}
28-
${headerMock} | ${sortingMock} | ${'row'}
29-
`('Should render Header when header: $header, sorting: $sorting, scope: $scope', ({ header, sorting, scope }) => {
30-
const { baseElement } = renderWithContainer(<Header scope={scope} label={header.label} sorting={sorting} {...defaultProps} />, container);
9+
scope
10+
${undefined}
11+
${'col'}
12+
${'row'}
13+
`('Should render Header when scope: $scope', ({ scope }) => {
14+
const { baseElement } = renderWithContainer(<Header scope={scope} label="label" />, container);
3115

3216
within(baseElement).getByRole(scope === 'col' || scope === undefined ? 'columnheader' : 'rowheader');
3317
screen.getByText('label');

0 commit comments

Comments
 (0)