forked from BloomTech-Labs/deprecated-30-story-squad-fe-a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawingSubContainer.test.js
39 lines (34 loc) · 1 KB
/
DrawingSubContainer.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { render, cleanup } from '@testing-library/react';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-redux';
import { ChildLoadingComponent } from '../components/common';
import { DrawingSub } from '../components/pages/DrawingSub';
const mockStore = configureStore([]);
const store = mockStore();
afterEach(cleanup);
jest.mock('@okta/okta-react', () => ({
useOktaAuth: () => {
return {
authState: {
isAuthenticated: true,
},
authService: {
getUser: () => Promise.reject(),
},
};
},
}));
describe('<DrawingSub /> test suite', () => {
test('container renders without crashing', async () => {
const { getByText } = render(
<Router>
<Provider store={store}>
<DrawingSub LoadingComponent={ChildLoadingComponent} />
</Provider>
</Router>
);
expect(getByText(/loading/i)).toBeInTheDocument();
});
});