Skip to content

Commit

Permalink
Update ReactDOM children tests to use createElement
Browse files Browse the repository at this point in the history
These tests were throwing warnings because of the new deprecation of
React.DOM.

Also re-records fiber tests.
  • Loading branch information
nhunzaker committed Jan 23, 2017
1 parent a24d210 commit da03cba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions scripts/fiber/tests-failing.txt
Expand Up @@ -9,10 +9,6 @@ src/isomorphic/classic/__tests__/ReactContextValidator-test.js
src/renderers/dom/__tests__/ReactDOMProduction-test.js
* should throw with an error code in production

src/renderers/dom/shared/__tests__/ReactDOM-test.js
* should allow children to be passed as an argument
* should overwrite props.children with children argument

src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
* should clean up input value tracking
* should clean up input textarea tracking
Expand Down
2 changes: 2 additions & 0 deletions scripts/fiber/tests-passing.txt
Expand Up @@ -627,6 +627,8 @@ src/renderers/dom/shared/__tests__/ReactBrowserEventEmitter-test.js

src/renderers/dom/shared/__tests__/ReactDOM-test.js
* allows a DOM element to be used with a string
* should allow children to be passed as an argument
* should overwrite props.children with children argument
* should purge the DOM cache when removing nodes
* throws in render() if the mount callback is not a function
* throws in render() if the update callback is not a function
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/dom/shared/__tests__/ReactDOM-test.js
Expand Up @@ -53,15 +53,15 @@ describe('ReactDOM', () => {

it('should allow children to be passed as an argument', () => {
var argDiv = ReactTestUtils.renderIntoDocument(
React.DOM.div(null, 'child')
React.createElement('div', null, 'child')
);
var argNode = ReactDOM.findDOMNode(argDiv);
expect(argNode.innerHTML).toBe('child');
});

it('should overwrite props.children with children argument', () => {
var conflictDiv = ReactTestUtils.renderIntoDocument(
React.DOM.div({children: 'fakechild'}, 'child')
React.createElement('div', {children: 'fakechild'}, 'child')
);
var conflictNode = ReactDOM.findDOMNode(conflictDiv);
expect(conflictNode.innerHTML).toBe('child');
Expand Down

0 comments on commit da03cba

Please sign in to comment.