import { render } from '@testing-library/react'; import Popover from './Popover'; import Text from './Text'; describe('Popover', () => { it('renders correctly', () => { const element = document.createElement('div'); const { container } = render( Custom children , ); expect(container).toMatchSnapshot(); }); it('renders correctly with portal', () => { const element = document.createElement('div'); const { baseElement } = render( Children , ); expect(baseElement).toMatchSnapshot(); }); it('does not render when the anchor is null', () => { const { container } = render( {}}> Children , ); expect(container).toMatchSnapshot(); }); });