import React from 'react'; import { render, cleanup } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; import { Portal } from './index'; afterEach(cleanup); test('should take a snapshot', () => { const { asFragment } = render(
Content
); expect(asFragment()).toMatchSnapshot(); }); describe('Tests Portal', () => { test('should mount to an existing id', () => { const { asFragment } = render(
Content
Existing element
); expect(asFragment()).toMatchSnapshot(); }); });