import React from 'react' import renderer from 'react-test-renderer' import { shallow } from 'enzyme' import { A11yProps } from '../_utils/interfaces' import { HintBubble } from './HintBubble' import { Hint, HintBubblePosition } from './index' const testChild = (a11yAttrs: A11yProps): React.ReactNode =>

I have an hint.

const defaultProps = { mainTitle: 'Hint Title', closeButtonTitle: 'Close', description: 'Hint Description', } describe('Hint', () => { it('Default rendering (above)', () => { const hint = renderer.create({testChild}).toJSON() expect(hint).toMatchSnapshot() }) it('Default rendering (below)', () => { const hint = renderer .create( {testChild} , ) .toJSON() expect(hint).toMatchSnapshot() }) it('Should render a HintBubble', () => { const hint = shallow({testChild}) expect(hint.find(HintBubble)).toHaveLength(1) }) it('Should not render a HintBubble if prop hidden is set to true', () => { const hint = shallow( , ) expect(hint.find(HintBubble)).toHaveLength(0) }) })