import { render, RenderOptions } from "@testing-library/react" import { PropsWithChildren, ReactElement } from "react" import { BrowserRouter } from "react-router-dom" import { Providers } from "../../src/providers/providers" const Wrapper = ({ children }: PropsWithChildren) => { return ( {children} ) } const customRender = ( ui: ReactElement, options?: Omit ) => render(ui, { wrapper: Wrapper, ...options }) export const renderWithProviders = ( ui: ReactElement, { route = "/" } = {}, options?: Omit ) => { window.history.pushState({}, "Test page", route) return customRender(ui, options) }