title: mocha + jsdom + React TypeError: Cannot read property 'addEventListener' of undefined
body: <p>I'm just getting started unit testing a React 0.10.0 component with mocha 2.3.3, jsdom 6.5.1, and Node.js 4.1.1. I have this for my unit test:</p>
  
  <pre><code>var React = require('react/addons');
  var TestUtils = React.addons.TestUtils;
  var sinon = require('sinon');
  var expect = require('chai').expect;
  var jsdom = require('jsdom');
  var view = require('../student-name-view.js');
  
  describe('The student name view', function() {
  
      var renderedComponent = null;
      var nameChangedStub = sinon.stub();
      var nameSubmittedStub = sinon.stub();
  
      before(function() {
          global.document = jsdom.jsdom('&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;');
          global.window = document.parentWindow;
          this.renderedComponent = TestUtils.renderIntoDocument(
              view({
                  nameChanged:   nameChangedStub,
                  nameSubmitted: nameSubmittedStub
              })
          );
          this.nameInput = TestUtils.findRenderedDOMComponentWithTag(renderedComponent, 'input').getDOMNode();
      });
  
      describe('should notify the controller', function() {
  
          it('when the name field changes', function() {
              TestUtils.Simulate.change(this.nameInput);
              expect(nameChangedStub.called).to.be.true;
          });
  
      });
  
  });
  </code></pre>
  
  <p>And this is my simple React view:</p>
  
  <pre><code>var React = require('react');
  
  var StudentNameView = React.createClass({
  
      render: function() {
          return React.DOM.div({
              id: 'name-container',
              children: [
                  React.DOM.p({
                      children: 'Enter your name'
                  }),
                  React.DOM.input({
                      id: 'nameInput',
                      onChange: this.props.nameChanged
                  }),
                  React.DOM.button({
                      id: 'doneButton'
                  })
              ]
          })
      }
  
  });
  
  module.exports = StudentNameView;
  </code></pre>
  
  <p>When I run the test, I get this stack trace:</p>
  
  <pre><code> TypeError: Cannot read property 'addEventListener' of undefined
    at Object.EventListener.listen (node_modules/react/lib/EventListener.js:21:15)
    at Object.merge.ensureScrollValueMonitoring (node_modules/react/lib/ReactEventEmitter.js:315:21)
    at Object.ReactMount._registerComponent (node_modules/react/lib/ReactMount.js:282:23)
    at Object.&lt;anonymous&gt; (node_modules/react/lib/ReactMount.js:305:36)
    at Object._renderNewRootComponent (node_modules/react/lib/ReactPerf.js:57:21)
    at Object.ReactMount.renderComponent (node_modules/react/lib/ReactMount.js:359:32)
    at Object.renderComponent (node_modules/react/lib/ReactPerf.js:57:21)
    at Object.ReactTestUtils.renderIntoDocument (node_modules/react/lib/ReactTestUtils.js:57:18)
    at Context.&lt;anonymous&gt; (test/student-name-view-test.js:19:44)
  </code></pre>
  
  <p>Any ideas what I'm doing wrong?</p>