forked from BloomTech-Labs/deprecated-30-story-squad-fe-a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RenderParentDashboard.test.js
58 lines (52 loc) · 1.58 KB
/
RenderParentDashboard.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { render, screen, cleanup } from '@testing-library/react';
import RenderParentDashboard from '../components/pages/ParentDashboard/RenderParentDashboard';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-redux';
const mockStore = configureStore([]);
const store = mockStore();
afterEach(() => {
cleanup();
});
jest.mock('@okta/okta-react', () => ({
useOktaAuth: () => {
return {
authState: {
isAuthenticated: true,
},
authService: {},
};
},
}));
const Component = props => {
return (
<Router>
<Provider store={store}>
<RenderParentDashboard {...props} />
</Provider>
</Router>
);
};
describe('<ParentDashboard /> test suite', () => {
test('Welcome Back', () => {
render(<Component parent={{ children: [] }} />);
expect(screen.getByText(/Welcome Back/i)).toBeInTheDocument();
});
test('Dashboard Nav', () => {
render(<Component parent={{ children: [] }} />);
expect(screen.getByText(/Dashboard/i)).toBeInTheDocument();
});
test('Help Nav', () => {
render(<Component parent={{ children: [] }} />);
expect(screen.getByText(/Help/i)).toBeInTheDocument();
});
test('Parent Settings Nav', () => {
render(<Component parent={{ children: [] }} />);
expect(screen.getByText(/Parent Settings/i)).toBeInTheDocument();
});
test('Log out Nav', () => {
render(<Component parent={{ children: [] }} />);
expect(screen.getByText(/log out/i)).toBeInTheDocument();
});
});