import { render } from '@testing-library/react'; import type { ComponentProps } from 'react'; import { ThemeProvider } from 'styled-components'; import { theme } from '../theme'; import { Badge } from './Badge'; const getComponent = (props: ComponentProps) => { return render( {props.children} ); }; describe('Badge', () => { it('renders the children', () => { const { getByText } = getComponent({ type: 'info', children: 'Foo bar' }); expect(() => getByText('Foo bar')).not.toThrow(); }); });