Skip to content

Commit 0797798

Browse files
committed
fixed test
1 parent eab1298 commit 0797798

File tree

5 files changed

+30139
-29862
lines changed

5 files changed

+30139
-29862
lines changed

tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"jest-environment-jsdom": "^29.2.2",
1010
"react": "^18.2.0",
1111
"react-dom": "^18.2.0",
12+
"react-router-dom": "^6.18.0",
1213
"react-test-renderer": "^18.2.0",
1314
"testing": "workspace:^",
1415
"ts-jest": "^29.0.3",

tests/tools/Dashboard.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import renderer from 'react-test-renderer';
22
import React from 'react';
33
import {Dashboard} from 'webui/src/tools/Dashboard';
44
import {ToolBoxContextProvider} from 'webui/src/context/ToolBoxContext';
5+
import {MemoryRouter} from 'react-router-dom'
56

67
describe('Dashboard', () => {
78
it('renders', () => {
8-
const component = renderer.create(<ToolBoxContextProvider>
9-
<Dashboard/>,
10-
</ToolBoxContextProvider>
9+
const component = renderer.create(<MemoryRouter>
10+
<ToolBoxContextProvider>
11+
<Dashboard/>,
12+
</ToolBoxContextProvider>
13+
</MemoryRouter>
1114
);
1215

1316
expect(component.toTree()).toMatchSnapshot();

0 commit comments

Comments
 (0)