title: test case for a react component method with jest and enzyme
body: <p>I am new to unit testing. I have a react component</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default class Login extends Component{
    constructor(){
      super()
      this.state={
        email: '',
        password:'',
        validFields: false
      }
      
      this.handleChangeInput = this.handleChangeInput.bind(this);
    }
    
    handleChangeInput(e){
      const name = e.target.name;
      const value = e.target.value;
      this.setState({[name]: value});
      if (this.state.email.length&gt;0 &amp;&amp;         this.state.password.length&gt;0 ) {
        this.setState({validFields: true});
      } else {
        this.setState({validFields: false});
      }
    }
    
    render() {
      return (
        &lt;div&gt;
          &lt;form onSubmit={this.handleLoginSubmit}&gt;
            &lt;div className="input"&gt;
              &lt;input id="email" type="text" name ="email" placeholder="Email" value={this.state.email} onChange={this.handleChangeInput}/&gt;
            &lt;/div&gt;
            &lt;div className="input"&gt;
              &lt;input id="password" type="password" name="password" placeholder="Password" value={this.state.password} onChange={this.handleChangeInput}/&gt;
            &lt;/div&gt;
            &lt;input id="submitButton" type="submit" value ="LOG IN" disabled={!this.state.validFields}/&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      )
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now I want to test the function handleChangeInput(e). Can anyone help to simulate the test case for the function ? I am using jest and enzyme.</p>