title: Enzyme simulate an onChange event
body: <p>I'm testing a react component with Mocha and Enzyme. Here is the component (shortened for simplicity of course):</p>
  
  <pre><code>class New extends React.Component {
  
    // shortened for simplicity
  
    handleChange(event) {
      // handle changing state of input
  
      const target = event.target;
      const value = target.value;
      const name = target.name
      this.setState({[name]: value})
  
    }
  
  
    render() {
      return(
        &lt;div&gt;
          &lt;form onSubmit={this.handleSubmit}&gt;
            &lt;div className="form-group row"&gt;
              &lt;label className="col-2 col-form-label form-text"&gt;Poll Name&lt;/label&gt;
              &lt;div className="col-10"&gt;
                &lt;input
                  className="form-control"
                  ref="pollName"
                  name="pollName"
                  type="text"
                  value={this.state.pollName}
                  onChange={this.handleChange}
                /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  
            &lt;input className="btn btn-info"  type="submit" value="Submit" /&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  
  <p>And here is the test:</p>
  
  <pre><code>it("responds to name change", done =&gt; {
    const handleChangeSpy = sinon.spy();
    const event = {target: {name: "pollName", value: "spam"}};
    const wrap = mount(
      &lt;New handleChange={handleChangeSpy} /&gt;
    );
  
    wrap.ref('pollName').simulate('change', event);
    expect(handleChangeSpy.calledOnce).to.equal(true);
  })
  </code></pre>
  
  <p>I am expecting that when the user types text into the <code>&lt;input&gt;</code> box the <code>handleChange</code> method will be called. The test above fails with: </p>
  
  <pre><code>AssertionError: expected false to equal true
  + expected - actual
  
  -false
  +true
  
  at Context.&lt;anonymous&gt; (test/components/new_component_test.js:71:45)
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <h1>EDIT</h1>
  
  <p>I should clarify, my objective is to test that the method <code>handleChange</code> is called. How can I do that?</p>