@samitouri / QOS-React / commits / af4d249aa9

fixes tests so they correctly pass in fiber

Dominic Gannaway committed Mar 6, 2017 at 15:15 UTC af4d249aa907139e41801b081e14da351ef25485
4 files changed +4 -69
scripts/fiber/tests-passing-except-dev.txt
-58
@@ -1,61 +1,3 @@
1 -src/renderers/__tests__/ReactComponentTreeHook-test.js
2 -* uses displayName or Unknown for classic components
3 -* uses displayName, name, or ReactComponent for modern components
4 -* uses displayName, name, or Object for factory components
5 -* uses displayName, name, or StatelessComponent for functional components
6 -* reports a host tree correctly
7 -* reports a simple tree with composites correctly
8 -* reports a tree with composites correctly
9 -* ignores null children
10 -* ignores false children
11 -* reports text nodes as children
12 -* reports a single text node as a child
13 -* reports a single number node as a child
14 -* reports a zero as a child
15 -* skips empty nodes for multiple children
16 -* reports html content as no children
17 -* updates text of a single text child
18 -* updates from no children to a single text child
19 -* updates from a single text child to no children
20 -* updates from html content to a single text child
21 -* updates from a single text child to html content
22 -* updates from no children to multiple text children
23 -* updates from multiple text children to no children
24 -* updates from html content to multiple text children
25 -* updates from multiple text children to html content
26 -* updates from html content to no children
27 -* updates from no children to html content
28 -* updates from one text child to multiple text children
29 -* updates from multiple text children to one text child
30 -* updates text nodes when reordering
31 -* updates host nodes when reordering with keys
32 -* updates host nodes when reordering without keys
33 -* updates a single composite child of a different type
34 -* updates a single composite child of the same type
35 -* updates from no children to a single composite child
36 -* updates from a single composite child to no children
37 -* updates mixed children
38 -* updates with a host child
39 -* updates from null to a host child
40 -* updates from a host child to null
41 -* updates from a host child to a composite child
42 -* updates from a composite child to a host child
43 -* updates from null to a composite child
44 -* updates from a composite child to null
45 -* updates with a host child
46 -* updates from null to a host child
47 -* updates from a host child to null
48 -* updates from a host child to a composite child
49 -* updates from a composite child to a host child
50 -* updates from null to a composite child
51 -* updates from a composite child to null
52 -* tracks owner correctly
53 -* purges unmounted components automatically
54 -* reports update counts
55 -* does not report top-level wrapper as a root
56 -* registers inlined text nodes
57 -* works
58 -
1 src/renderers/__tests__/ReactComponentTreeHook-test.native.js
2 * uses displayName or Unknown for classic components
3 * uses displayName, name, or ReactComponent for modern components
src/isomorphic/hooks/ReactComponentTreeHook.js
+1 -4
@@ -182,10 +182,7 @@ function describeID(id: DebugID): string {
182 'building stack',
183 id
184 );
185 - if (element && name) {
186 - return describeComponentFrame(name || '', element._source, ownerName || '');
187 - }
188 - return '';
185 + return describeComponentFrame(name || '', element && element._source, ownerName || '');
186 }
187
188 var ReactComponentTreeHook = {
src/renderers/__tests__/ReactComponentTreeHook-test.js
+1 -1
@@ -1736,7 +1736,7 @@ describe('ReactComponentTreeHook', () => {
1736 expectDev(ReactComponentTreeTestUtils.getRegisteredDisplayNames()).toEqual([]);
1737 });
1738
1739 - describe('stack addenda', () => {
1739 + describe.only('stack addenda', () => {
1740 it('gets created', () => {
1741 function getAddendum(element) {
1742 var addendum = ReactComponentTreeHook.getCurrentStackAddendum(element);
src/shared/ReactFiberComponentTreeHook.js
+2 -6
@@ -22,9 +22,8 @@ var {
22 var getComponentName = require('getComponentName');
23
24 import type { Fiber } from 'ReactFiber';
25 -import type { Source } from 'ReactElementType';
25
27 -function describeComponentFrame(name, source: Source, ownerName) {
26 +function describeComponentFrame(name, source: any, ownerName) {
27 return '\n in ' + (name || 'Unknown') + (
28 source ?
29 ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' +
@@ -48,10 +47,7 @@ function describeFiber(fiber : Fiber) : string {
47 if (owner) {
48 ownerName = getComponentName(owner);
49 }
51 - if (source) {
52 - return describeComponentFrame(name, source, ownerName);
53 - }
54 - return '';
50 + return describeComponentFrame(name, source, ownerName);
51 default:
52 return '';
53 }