title: React enzyme + jest how to test onSubmit
body: <pre><code>const handleSubmit = (e) =&gt; {
   .preventDefault();
   if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)) {
    setError(true);
    return;
   }
  if (loading) return;
    setError(false);
    setLoading(true);
    return Axios.post("/send-email", { value, messageHtml }).then(() =&gt; {
     clearTimeout(timerId);
     setSuccess(true);
     setLoading(false);
     setValue("");
     timerId = setTimeout(() =&gt; {
      setSuccess(false);
     }, 5000);
      }).catch(() =&gt; setLoading(false));
    };
  
  render(
  &lt;form onSubmit={handleSubmit} id="get-list-form" autoComplete="off"&gt;
   &lt;input
     value={value}
     required
     onChange={handleChange}
     className="input 
     placeholder="Enter your email "
     type="text"
    /&gt;  
  &lt;button type="submit" className={`button ${btnClass}`}&gt;{btnMessage}&lt;/button&gt;
   &lt;/form&gt;
  );
  </code></pre>
  
  <blockquote>
    <p><strong>i have this code. this is a functional component.</strong>
        and how can i test handleSubmit  function?? or intercept axios call?
        its called on onSubmit event.
        its called on onSubmit event.</p>
  </blockquote>
  
  <pre><code>wrapper.find('form') .simulate('submit', { preventDefault () {} });
  
  **this code successfuly called onSubmit on form,
  but i dont understand how to test axios call inside her.**
  </code></pre>