Skip to content

Commit 69307a1

Browse files
committed
fix create-react-app test with latest RA
1 parent bdc6a76 commit 69307a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/create-react-admin/src/generateAppTestFile.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ export const generateAppTestFile = (
1010
path.join(projectDirectory, 'src', 'App.spec.tsx'),
1111
`
1212
import { fireEvent, render, screen } from "@testing-library/react";
13+
import { MemoryRouter } from "react-router";
1314
import { App } from "./App";
1415
1516
test("should pass", async () => {
1617
vi.spyOn(window, "scrollTo").mockImplementation(() => { /* do nothing */ });
17-
render(<App />);
18+
render(
19+
<MemoryRouter>
20+
<App />
21+
</MemoryRouter>,
22+
);
1823
${
1924
state.authProvider !== 'none'
2025
? `

0 commit comments

Comments
 (0)