<commit_before>var React = require('react'),
    Parent = React.createFactory(require('../../../src/components/parent.jsx')),
    TestUtils = require('react/addons').addons.TestUtils,
    TestHelpers = require('../../helpers.js'),
    $ = require('jquery');


describe('Parent', function() {
  var component;
  var doStuffStub;


  beforeEach(function() {
    doStuffStub = TestHelpers.stubMethod(Parent, 'doStuff');

    component = React.render(Parent(), this.container);
  });

  it('should call to do stuff', function() {
    TestUtils.Simulate.click(component.refs.btn.getDOMNode());
    expect(doStuffStub).to.have.been.called;
  });

  it('should render stuff', function() {
    expect($(component.refs.stuff.getDOMNode()).text()).to.equal('tomato');
  });
});

<commit_msg>Test that Parent renders Child<commit_after>var React = require('react'),
    Parent = React.createFactory(require('../../../src/components/parent.jsx')),
    TestUtils = require('react/addons').addons.TestUtils,
    TestHelpers = require('../../helpers.js'),
    $ = require('jquery');


describe('Parent', function() {
  var component;
  var doStuffStub, loadChildStub;


  beforeEach(function() {
    loadChildStub = TestHelpers.stubMethod(Parent, 'loadChild', null);
    doStuffStub = TestHelpers.stubMethod(Parent, 'doStuff');

    component = React.render(Parent(), this.container);
  });

  it('should call to do stuff', function() {
    TestUtils.Simulate.click(component.refs.btn.getDOMNode());

    expect(doStuffStub).to.have.been.called;
  });

  it('should render stuff', function() {
    expect($(component.refs.stuff.getDOMNode()).text()).to.equal('tomato');
  });

  it('should render a child', function() {
    expect(loadChildStub).to.have.been.calledWith('child');
  });
});


{'fraction_non_alphanumeric': 0.18862612612612611, 'fraction_numerical': 0.0, 'mean_word_length': 4.165697674418604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1988398', 'n_tokens_mistral': 565, 'n_tokens_neox': 556, 'n_words': 87}