Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { mount } from 'enzyme'
- import PrivateRoute from 'PrivateRoute..Location'
- import ProtectedComponent from 'ProtectedComponent..Location'
- const wrapper = mount(<PrivateRoute component={ProtectedComponent}> </PrivateRoute>)
- test('should show Proctected component when Logged In', () => {
- // TODO:
- // Make an request to auth user here
- expect(wrapper.find(ProctectedComponent).props().className).toBe('---ProtecteComponentClassName---')
- });
- test('should show Login component when not Logged In', () => {
- // TODO:
- // Make a request to unauth user here
- expect(wrapper.find(ProctectedComponent).props().className).toBe('---LoginComponentClassName---')
- });
Add Comment
Please, Sign In to add comment