FIX tests

Signed-off-by: Damian Krysta <damian@krysta.dev>
This commit is contained in:
Damian Krysta 2022-02-01 23:34:15 +01:00 committed by Scott Lamb
parent 56918bf5c2
commit 3240c20eae
2 changed files with 9 additions and 4 deletions

6
ui/package-lock.json generated
View File

@ -5059,9 +5059,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001245",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001245.tgz",
"integrity": "sha512-768fM9j1PKXpOCKws6eTo3RHmvTUsG9UrpT4WoREFeZgJBTi4/X9g565azS/rVUGtqb8nt7FjLeF5u4kukERnA=="
"version": "1.0.30001304",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz",
"integrity": "sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ=="
},
"capture-exit": {
"version": "2.0.0",

View File

@ -4,6 +4,7 @@
import { createTheme, ThemeProvider } from "@mui/material/styles";
import { render } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { SnackbarProvider } from "./snackbars";
export function renderWithCtx(
@ -12,7 +13,11 @@ export function renderWithCtx(
function wrapped(children: React.ReactElement): React.ReactElement {
return (
<ThemeProvider theme={createTheme()}>
<SnackbarProvider autoHideDuration={5000}>{children}</SnackbarProvider>
<SnackbarProvider autoHideDuration={5000}>
<MemoryRouter>
{children}
</MemoryRouter>
</SnackbarProvider>
</ThemeProvider>
);
}