Skip to content

Commit

Permalink
Rewrite traverseAllChildren() tests against React.Children API
Browse files Browse the repository at this point in the history
This function was used in React.Children and Stack.

The corresponding reconciliation functionality is being tested by ReactMultiChild tests.

So we can move these tests to ReactChildren and test its public API.
  • Loading branch information
gaearon committed Nov 28, 2016
1 parent 71eefd0 commit 2b7e0a0
Show file tree
Hide file tree
Showing 5 changed files with 532 additions and 619 deletions.
4 changes: 1 addition & 3 deletions scripts/fiber/tests-passing-except-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,9 @@ src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js

src/renderers/shared/shared/__tests__/ReactMultiChild-test.js
* should warn for duplicated keys with component stack info
* should warn for using maps as children with owner info

src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js
* should warn for childContextTypes on a functional component
* should warn when given a ref
* should use correct name in key warning

src/shared/utils/__tests__/traverseAllChildren-test.js
* should warn for using maps as children with owner info
27 changes: 11 additions & 16 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ src/isomorphic/children/__tests__/ReactChildren-test.js
* should support identity for simple
* should treat single arrayless child as being in array
* should treat single child in array as expected
* should be called for each child
* should traverse children of different kinds
* should be called for each child in nested structure
* should retain key across two mappings
* should be called for each child in an iterable without keys
* should be called for each child in an iterable with keys
* should use keys from entry iterables
* should not enumerate enumerable numbers (#4776)
* should allow extension of native prototypes
* should pass key to returned component
* should invoke callback with the right context
* should be called for each child
Expand All @@ -122,6 +131,8 @@ src/isomorphic/children/__tests__/ReactChildren-test.js
* should count the number of children in flat structure
* should count the number of children in nested structure
* should flatten children to an array
* should throw on object
* should throw on regex

src/isomorphic/children/__tests__/onlyChild-test.js
* should fail when passed two children
Expand Down Expand Up @@ -1536,22 +1547,6 @@ src/shared/utils/__tests__/PooledClass-test.js
src/shared/utils/__tests__/reactProdInvariant-test.js
* should throw with the correct number of `%s`s in the URL

src/shared/utils/__tests__/traverseAllChildren-test.js
* should support identity for simple
* should treat single arrayless child as being in array
* should treat single child in array as expected
* should be called for each child
* should traverse children of different kinds
* should be called for each child in nested structure
* should retain key across two mappings
* should be called for each child in an iterable without keys
* should be called for each child in an iterable with keys
* should use keys from entry iterables
* should not enumerate enumerable numbers (#4776)
* should allow extension of native prototypes
* should throw on object
* should throw on regex

src/test/__tests__/ReactTestUtils-test.js
* should have shallow rendering
* should shallow render a functional component
Expand Down
Loading

0 comments on commit 2b7e0a0

Please sign in to comment.