import React from 'react'; import { render, cleanup } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; import { Menu } from './index'; jest.mock('../Portal'); let openTestValue = true; const closeTestValue = () => (openTestValue = false); afterEach(cleanup); test('should take a snapshot', () => { const { asFragment } = render(
); expect(asFragment()).toMatchSnapshot(); }); describe('Tests Menu', () => { test('with content', () => { const { getByTestId } = render( ); expect(getByTestId('menu-id')).toBeInTheDocument(); }); test('with open=false', () => { const { getByTestId } = render(