test-utils: remove route wrapping in test app wrapper

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-23 18:20:15 +02:00
parent 7d6f541839
commit e33b9dbc9c
@@ -15,7 +15,7 @@
*/
import React, { ComponentType, ReactNode, ReactElement } from 'react';
import { MemoryRouter, Routes } from 'react-router';
import { MemoryRouter } from 'react-router';
import { Route } from 'react-router-dom';
import { lightTheme } from '@backstage/theme';
import { ThemeProvider } from '@material-ui/core/styles';
@@ -184,11 +184,7 @@ export function createTestAppWrapper(
<AppProvider>
<AppRouter>
<NoRender>{routeElements}</NoRender>
{/* The path of * here is needed to be set as a catch all, so it will render the wrapper element
* and work with nested routes if they exist too */}
<Routes>
<Route path="/*" element={<>{children}</>} />
</Routes>
{children}
</AppRouter>
</AppProvider>
);