#6585

);
    });
  });
  describe('unmountComponent', function() {
    it('should clean up listeners', function() {
      var EventPluginHub = require('EventPluginHub');
      var ReactDOMComponentTree = require('ReactDOMComponentTree');
      var container = document.createElement('div');
      document.body.appendChild(container);
      var callback = function() {};
      var instance = <div onClick={callback} />;
      instance = ReactDOM.render(instance, container);
      var rootNode = ReactDOM.findDOMNode(instance);
      var inst = ReactDOMComponentTree.getInstanceFromNode(rootNode);
      expect(
        EventPluginHub.getListener(inst, 'onClick')
      ).toBe(callback);
      expect(rootNode).toBe(ReactDOM.findDOMNode(instance));
      ReactDOM.unmountComponentAtNode(container);
      expect(
        EventPluginHub.getListener(inst, 'onClick')
      ).toBe(undefined);
    });
    it('should clean up input value tracking', function() {
      var container = document.createElement('div');
      var node = ReactDOM.render(<input type="text" defaultValue="foo"/>, container);
      var tracker = inputValueTracking._getTrackerFromNode(node);
      spyOn(tracker, 'stopTracking');
      ReactDOM.unmountComponentAtNode(container);
      expect(tracker.stopTracking.calls.length).toBe(1);