Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let props = {
- actions: mockProps.actions,
- auth: {
- isAuthenticated: false,
- isFetching: false
- },
- history: mockProps.history,
- location: {
- pathname: "/login",
- search: "",
- hash: "",
- key: "0m32x8"
- },
- match: mockProps.match
- }
- // Working Shallow Rendered Test
- it('componentWillReceiveProps', () => {
- const componentWillReceivePropsSpy = jest.spyOn(Login.prototype, 'componentWillReceiveProps')
- shallowWrapper.setProps({ location: { search: "testing" } })
- expect(componentWillReceivePropsSpy).toHaveBeenCalled()
- })
- // Broken Mount Rendered Test
- it('Mount Test', () => {
- mount(<Provider store={store}><Login {...props}/></Provider>)
- })
- state = {
- shouldRedirect: false,
- errorShown: false,
- fields: {
- username: '',
- password: ''
- },
- token: q.parse(this.props.location.search).token,
- fieldErrors: {}
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement