Skip to content

Commit 64452e1

Browse files
refactor(global): refactor tests and add missing "type" on import
1 parent c28646b commit 64452e1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/pages/Demos/Members/Members.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Layout, { type TLayoutPage } from 'Layout';
33
import Loader, { type TLoader } from 'shared/components/Loader';
44
import Resilience from 'shared/components/Resilience';
55
import Table from 'shared/components/Table';
6-
import { Tanomaly } from 'shared/types';
6+
import type { Tanomaly } from 'shared/types';
77
import type { TReturnUseMembers } from './Members.hook';
88
import { TABLE_HEADERS_MEMBERS, TABLE_ITEMS_TYPE, TITLE, TITLE_BAR } from './constants';
99

src/shared/components/Table/Body/Line/Td/__tests__/Td.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderWithContainer } from 'shared/testsUtils';
1+
import { renderWithContainer, within } from 'shared/testsUtils';
22
import Td from '../Td';
33

44
const defaultProps = {
@@ -11,7 +11,7 @@ const trContainer = document.createElement('tr');
1111
describe('Td', () => {
1212
it('Render <Td/> without hover', () => {
1313
const { container } = renderWithContainer(<Td {...defaultProps}>child th</Td>, trContainer);
14-
expect(container.firstChild?.firstChild?.textContent).toBe('label');
14+
within(container).getByText(/label/);
1515
});
1616

1717
it('Render <Td/> with hover', () => {
@@ -21,6 +21,6 @@ describe('Td', () => {
2121
</Td>,
2222
trContainer,
2323
);
24-
expect(container.firstChild?.firstChild).toHaveClass('af-popover__wrapper');
24+
container.getElementsByClassName('af-popover__wrapper');
2525
});
2626
});

src/shared/components/Table/Header/Th/ThSortable/__tests__/ThSortable.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('ThSortable', () => {
2727
trContainer,
2828
);
2929

30-
expect(container.querySelector('span')).toHaveClass(`glyphicon-${orderIcons(order)}`);
30+
expect(container.querySelector(`.glyphicon-${orderIcons(order)}`)).toBeInTheDocument();
3131

3232
if (children) {
3333
within(baseElement).getByText(children);

0 commit comments

Comments
 (0)