jest enzyme test receive submit

Solutions on MaxInterview for jest enzyme test receive submit by the best coders in the world

showing results for - "jest enzyme test receive submit"
Jakob
29 Oct 2016
1 // Unit test
2  describe('SomeComponent' () => {
3  it('validates model on button click', () => {
4      const handleSubmit = jest.fn();
5      const wrapper = mount(
6          <Login handleSubmit={handleSubmit}/>
7      );
8      const instance = wrapper.instance();
9      const submitBtn = app.find('#sign-in')
10      submitBtn.simulate('click')
11      expect(handleSubmit).toHaveBeenCalled();
12    });
13  }
14