import { cleanup } from '@testing-library/react'; import { render } from '../../../utils/theme-render-wrapper'; import { ASSETS_URL } from '../../../consts/common'; import { DialogTitle } from './dialog-title'; afterEach(cleanup); const handleClose = jest.fn(); describe('', () => { it(`Should render with onClose prop`, () => { const { queryByTestId } = render(Modal Title); const closeEl = queryByTestId('close'); closeEl?.click(); expect(handleClose).toHaveBeenCalled(); }); it(`Should render without onClose prop`, () => { render(Modal Title); }); it(`Should render with icon and title`, () => { const { container } = render( Modal Title ); const iconEl = container.getElementsByTagName('svg'); expect(iconEl).toBeTruthy(); }); });