I am new in unit testing in reactjs. I tried to test my login component rendering For testing, i am using JEST and enzyme.
[This is the error, i am getting]
Test case code:
import React from 'react';
import { shallow } from 'enzyme';
import Login from './index'; // Introduce the corresponding React component
it('renders Login page', () => {
const wrapper = shallow(<Login.WrappedComponent login={{ name: '' }} />);
})
i am using Real project with umi -
https://ant.design/docs/react/practical-projects
can any one help me on this.
We can use connect from react-redux instead of umi. actually umi is also using react-redux inside of it.
Replace this line in your component :
import { connect } from 'umi'
withimport { connect } from 'react-redux'