Merge branch 'master' into 13969-advanced-tab
[arvados.git] / src / views / workbench / workbench.test.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import * as ReactDOM from 'react-dom';
7 import { WorkbenchPanel } from './workbench';
8 import { Provider } from "react-redux";
9 import { configureStore } from "~/store/store";
10 import createBrowserHistory from "history/createBrowserHistory";
11 import { ConnectedRouter } from "react-router-redux";
12 import { MuiThemeProvider } from '@material-ui/core/styles';
13 import { CustomTheme } from '~/common/custom-theme';
14 import { createServices } from "~/services/services";
15 import 'jest-localstorage-mock';
16
17 const history = createBrowserHistory();
18
19 it('renders without crashing', () => {
20     const div = document.createElement('div');
21     const services = createServices("/arvados/v1");
22         services.authService.getUuid = jest.fn().mockReturnValueOnce('test');
23     const store = configureStore(createBrowserHistory(), services);
24     ReactDOM.render(
25         <MuiThemeProvider theme={CustomTheme}>
26             <Provider store={store}>
27                 <ConnectedRouter history={history}>
28                     <WorkbenchPanel />
29                 </ConnectedRouter>
30             </Provider>
31         </MuiThemeProvider>,
32     div);
33     ReactDOM.unmountComponentAtNode(div);
34 });