Answers for "jest enzyme test receive submit"

0

jest enzyme test receive submit

// Unit test
  describe('SomeComponent' () => {
  it('validates model on button click', () => {
      const handleSubmit = jest.fn();
      const wrapper = mount(
          <Login handleSubmit={handleSubmit}/>
      );
      const instance = wrapper.instance();
      const submitBtn = app.find('#sign-in')
      submitBtn.simulate('click')
      expect(handleSubmit).toHaveBeenCalled();
    });
  }
Posted by: Guest on January-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language