import { render } from '@testing-library/react'
import { Tooltip } from 'components/Tooltip'
describe('', () => {
const defaultProps = {
content: <>>,
}
it('should render', () => {
const { container } = render()
expect(container).toBeInTheDocument()
})
it('should handle `children` prop correctly', () => {
const { getByTestId } = render(
Test text
,
)
expect(getByTestId('test-child')).toBeInTheDocument()
})
it('should handle `className` prop correctly', () => {
const testClass = 'test-class'
const { container } = render()
expect(container.getElementsByClassName(testClass)).toHaveLength(1)
})
describe('should handle `underline` prop correctly', () => {
it('should have border class when children are passed', () => {
const { container } = render(
<>>
,
)
expect(container.getElementsByClassName('border-b-1')).toHaveLength(1)
})
it('should not have border class when children are passed', () => {
const { container } = render()
expect(container.getElementsByClassName('border-b-1')).toHaveLength(0)
})
})
})