import { render } from '@testing-library/react'; import Portal from './index'; describe('Portal', () => { const content =

Nice content

; it('should render content in a div', () => { const { baseElement } = render({content}); expect(baseElement).toMatchInlineSnapshot(`

Nice content

`); }); it('should remove the container div on unmount', () => { const { baseElement, unmount } = render({content}); unmount(); expect(baseElement).toMatchInlineSnapshot(`
`); }); });