title: How to test default props functions is attached to component or not ? | React | Jest | Enzyme
body: <p>How can we write the test to check defaultProps function in this case (
   <code>handleChange: () =&gt; {},handleBlur: () =&gt; {},handleSubmit: () =&gt; {}</code>) attached to dom and they are working correctly? </p>
  
  <p>I know we can test function when we pass as props but looking for help to test default functions. Thanks,  </p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  
  const LoginForm = ({
    handleChange,
    handleBlur,
    handleSubmit,
  }) =&gt; (
    &lt;form onSubmit={handleSubmit}&gt;
      &lt;input
        onChange={handleChange}
        onBlur={handleBlur}
      /&gt;
      &lt;input
        onChange={handleChange}
        onBlur={handleBlur}
      /&gt;
      &lt;button type="submit"&gt;
        Submit
      &lt;/button&gt;
    &lt;/form&gt;
  );
  
  const shape = { email: '', password: '', generic: '' };
  
  LoginForm.propTypes = {
    handleChange: PropTypes.func,
    handleBlur: PropTypes.func,
    handleSubmit: PropTypes.func,
  };
  
  LoginForm.defaultProps = {
    handleChange: () =&gt; {},
    handleBlur: () =&gt; {},
    handleSubmit: () =&gt; {},
  };
  
  export default LoginForm;
  </code></pre>