import React from 'react'; import { MemoryRouter, Route, StaticRouter } from 'react-router-dom'; import { Provider } from 'react-redux'; import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import configureStore from 'redux/store/configureStore'; interface TestRouterWrapperProps { pathname: string; urlParams: { [key: string]: string; }; } export const TestRouterWrapper: React.FC = ({ children, pathname, urlParams, }) => ( acc.replace(`:${param}`, urlParams[param]), pathname ), }, ]} > {children} ); export const containerRendersView = ( container: React.ReactElement, // eslint-disable-next-line @typescript-eslint/no-explicit-any view: React.FC ) => { describe('container', () => { const store = configureStore(); it('renders view', async () => { let wrapper = mount(
); await act(async () => { wrapper = mount( {container} ); }); expect(wrapper.exists(view)).toBeTruthy(); }); }); };