Guest User

Untitled

a guest
May 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import { mount } from 'enzyme'
  2.  
  3. import PrivateRoute from 'PrivateRoute..Location'
  4. import ProtectedComponent from 'ProtectedComponent..Location'
  5.  
  6. const wrapper = mount(<PrivateRoute component={ProtectedComponent}> </PrivateRoute>)
  7.  
  8. test('should show Proctected component when Logged In', () => {
  9. // TODO:
  10. // Make an request to auth user here
  11. expect(wrapper.find(ProctectedComponent).props().className).toBe('---ProtecteComponentClassName---')
  12. });
  13.  
  14. test('should show Login component when not Logged In', () => {
  15. // TODO:
  16. // Make a request to unauth user here
  17. expect(wrapper.find(ProctectedComponent).props().className).toBe('---LoginComponentClassName---')
  18. });
Add Comment
Please, Sign In to add comment