Fix a failing test and count IDs from one
Dan Abramov committed
May 12, 2016 at 02:32 UTC
9cebc2663888573b4b993a4a9096f7fac8c6a5a3
2 files changed
+4
-13
src/isomorphic/devtools/__tests__/ReactNativeOperationHistoryDevtool-test.js
+3
-12
@@ -65,24 +65,15 @@ describe('ReactNativeOperationHistoryDevtool', () => {
65
}]);
66
});
67
68
- it('gets recorded for composite roots that return null', () => {
68
+ it('gets ignored for composite roots that return null', () => {
69
function Foo() {
70
return null;
71
}
72
var node = document.createElement('div');
73
ReactDOM.render(<Foo />, node);
74
- var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
74
76
- if (ReactDOMFeatureFlags.useCreateElement) {
77
- // Empty DOM components should be invisible to devtools.
78
- assertHistoryMatches([]);
79
- } else {
80
- assertHistoryMatches([{
81
- instanceID: inst._debugID,
82
- type: 'mount',
83
- payload: '<!-- react-empty: 1 -->',
84
- }]);
85
- }
75
+ // Empty DOM components should be invisible to devtools.
76
+ assertHistoryMatches([]);
77
});
78
79
it('gets recorded when a native is mounted deeply instead of null', () => {
src/test/ReactTestUtils.js
+1
-1
@@ -376,7 +376,7 @@ ReactShallowRenderer.prototype.getMountedInstance = function() {
376
return this._instance ? this._instance._instance : null;
377
};
378
379
-var nextDebugID = 0;
379
+var nextDebugID = 1;
380
381
var NoopInternalComponent = function(element) {
382
this._renderedOutput = element;