Don't test for comments in empty components for Fiber
Fiber doesn't use comments in empty components.
Sebastian Markbage committed
Nov 20, 2016 at 20:31 UTC
826e90f5a05e06a681f168437469cf4996623d19
3 files changed
+13
-3
scripts/fiber/tests-failing.txt
-1
@@ -122,7 +122,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactCompositeComponentNestedSta
122
src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
123
* should still throw when rendering to undefined
124
* throws when rendering null at the top level
125
-* preserves the dom node during updates
125
126
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
127
* should correctly handle all possible children for render and update
scripts/fiber/tests-passing.txt
+1
@@ -1304,6 +1304,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
1304
* should have findDOMNode return null when multiple layers of composite components render to the same null placeholder
1305
* works when switching components
1306
* does not break when updating during mount
1307
+* preserves the dom node during updates
1308
1309
src/renderers/shared/stack/reconciler/__tests__/ReactErrorBoundaries-test.js
1310
* does not swallow exceptions on mounting without boundaries
src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
+12
-2
@@ -13,6 +13,7 @@
13
14
var React;
15
var ReactDOM;
16
+var ReactDOMFeatureFlags;
17
var ReactTestUtils;
18
var TogglingComponent;
19
@@ -24,6 +25,7 @@ describe('ReactEmptyComponent', () => {
25
26
React = require('React');
27
ReactDOM = require('ReactDOM');
28
+ ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
29
ReactTestUtils = require('ReactTestUtils');
30
31
log = jasmine.createSpy();
@@ -303,12 +305,20 @@ describe('ReactEmptyComponent', () => {
305
306
ReactDOM.render(<Empty />, container);
307
var noscript1 = container.firstChild;
306
- expect(noscript1.nodeName).toBe('#comment');
308
+ if (ReactDOMFeatureFlags.useFiber) {
309
+ expect(noscript1).toBe(null);
310
+ } else {
311
+ expect(noscript1.nodeName).toBe('#comment');
312
+ }
313
314
// This update shouldn't create a DOM node
315
ReactDOM.render(<Empty />, container);
316
var noscript2 = container.firstChild;
311
- expect(noscript2.nodeName).toBe('#comment');
317
+ if (ReactDOMFeatureFlags.useFiber) {
318
+ expect(noscript1).toBe(null);
319
+ } else {
320
+ expect(noscript2.nodeName).toBe('#comment');
321
+ }
322
323
expect(noscript1).toBe(noscript2);
324
});