this is my testing code
it('sets state openModal when form submitted', () => {
const actions = {
postData: jest.fn(),
};
const data = {
firstName: 'Test',
birthDate: 'tes',
email: '[email protected]',
phoneNumber: '0823',
province: 'A',
subdistrict: 'test',
}
const wrapper = shallow(
wrapper.find('#registerForm').simulate('submit');
expect(wrapper.state('openModal')).toEqual(true);
expect(actions.postData).toHaveBeenCalled();
});
but error like this
TypeError: Cannot read property 'split' of undefined
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions