<commit_before>var mocha = require('mocha');
var expect = require('chai').expect;

var React = require('react');
var ReactDOM = require('react-dom');
var TestUtils = require('react-addons-test-utils');
var mockStore = require('../../utils/mockStore');
var mockRequire = require('mockrequire');

//mock out the sub-component
var IndVar = mockRequire('../../../server/client/components/viewexperiment/IndVar', {}, {jsx: true});

//Dom Mocking setup..
var index = require('../index.js')();

describe('indVarsComponent', function () {
  var indVar;
  beforeEach(function () {
    var props = {};

    //this is our mock of the IndVar state property
    var obj = {
      IndVars : {
        a : {name: 'weezy',options:[1,2,3]},
        b : {name: 'steve',options:[3,2,1]}
      },
    };
    props.store = mockStore(obj);

    //also need to pass in keys
    props.indVarIds = ['a','b'];

    indVar = TestUtils.renderIntoDocument(React.createElement(IndVar, props), 'root');
  });

  it('should properly map the ids and render the names to <h3s>', function () {
    var h3s = TestUtils.scryRenderedDOMComponentsWithClass(indVar,'indvar');
    expect(ReactDOM.findDOMNode(h3s[0]).textContent).to.contain('weezy');
    expect(ReactDOM.findDOMNode(h3s[1]).textContent).to.contain('steve');
  });



});<commit_msg>Change spec to match indVars naming convention<commit_after>var mocha = require('mocha');
var expect = require('chai').expect;

var React = require('react');
var ReactDOM = require('react-dom');
var TestUtils = require('react-addons-test-utils');
var mockStore = require('../../utils/mockStore');
var mockRequire = require('mockrequire');

//mock out the sub-component
var IndVar = mockRequire('../../../server/client/components/viewexperiment/IndVar', {}, {jsx: true});

//Dom Mocking setup..
var index = require('../index.js')();

describe('indVarsComponent', function () {
  var indVar;
  beforeEach(function () {
    var props = {};

    //this is our mock of the IndVar state property
    var obj = {
      IndVars : {
        a : {name: 'weezy',options:[1,2,3]},
        b : {name: 'steve',options:[3,2,1]}
      },
    };
    props.store = mockStore(obj);

    //also need to pass in keys
    props.indVars = ['a','b'];

    indVar = TestUtils.renderIntoDocument(React.createElement(IndVar, props), 'root');
  });

  it('should properly map the ids and render the names to <h3s>', function () {
    var h3s = TestUtils.scryRenderedDOMComponentsWithClass(indVar,'indvar');
    expect(ReactDOM.findDOMNode(h3s[0]).textContent).to.contain('weezy');
    expect(ReactDOM.findDOMNode(h3s[1]).textContent).to.contain('steve');
  });



});
{'fraction_non_alphanumeric': 0.17982621836040802, 'fraction_numerical': 0.009066868152625614, 'mean_word_length': 3.8409506398537476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1881164', 'n_tokens_mistral': 864, 'n_tokens_neox': 860, 'n_words': 190}