Skip to content

Commit

Permalink
chore(testing): remove deprecation warnings
Browse files Browse the repository at this point in the history
removing some depreciation warnings during testing
  • Loading branch information
minicast committed Oct 26, 2015
1 parent a40964c commit caaade1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"mocha-jsdom": "1.0.0",
"mocha-lcov-reporter": "1.0.0",
"react": "0.14.0",
"react-addons-test-utils": "0.14.0",
"react-dom": "0.14.0",
"react-tools": "0.13.3",
"reactify": "1.1.1",
Expand Down
3 changes: 2 additions & 1 deletion src/CheckboxWithLabel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var React = require('react/addons');
// var React = require('react/addons');
var React = require('react');
var BigComplicatedComponent = require('./BigComplicatedComponent.js');
// var FormulaEditor = require('./FormulaEditor.js');

Expand Down
12 changes: 8 additions & 4 deletions tests/CheckboxWithLabel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ var assert = require('assert');

describe('CheckboxWithLabel', function() {
it('changes the text after click', function() {
var React = require('react/addons');
var CheckboxWithLabel = require('../src/CheckboxWithLabel');
var TestUtils = React.addons.TestUtils;
// var React = require('react/addons');
var React = require('react');
// var TestUtils = React.addons.TestUtils;
var TestUtils = require('react-addons-test-utils');

// Render a checkbox with label in the document
var checkbox = TestUtils.renderIntoDocument(
Expand All @@ -22,12 +24,14 @@ describe('CheckboxWithLabel', function() {
// Verify that it's Off by default
var label = TestUtils.findRenderedDOMComponentWithTag(
checkbox, 'label');
assert.equal(label.getDOMNode().textContent, 'Off');
// assert.equal(label.getDOMNode().textContent, 'Off');
assert.equal(label.textContent, 'Off');

// Simulate a click and verify that it is now On
var input = TestUtils.findRenderedDOMComponentWithTag(
checkbox, 'input');
TestUtils.Simulate.change(input);
assert.equal(label.getDOMNode().textContent, 'On');
// assert.equal(label.getDOMNode().textContent, 'On');
assert.equal(label.textContent, 'On');
});
});

0 comments on commit caaade1

Please sign in to comment.