Enable additional (failing) portal tests

This commit is contained in:
Dan Abramov committed 2016-12-09 16:07:37 +00:00
1 parent 14f05bfa89
commit 8eb192b92f
3 files changed
+20 -11

No files matched your search

+4
View File
@@ -18,6 +18,10 @@ src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js
src/renderers/dom/__tests__/ReactDOMProduction-test.js
* should throw with an error code in production
src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* should keep track of namespace across portals (medium)
* should unwind namespaces on caught errors in a portal
src/renderers/dom/shared/__tests__/ReactDOM-test.js
* throws in render() if the mount callback is not a function
* throws in render() if the update callback is not a function
-2
View File
@@ -515,11 +515,9 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* should render many portals
* should render nested portals
* should keep track of namespace across portals (simple)
* should keep track of namespace across portals (medium)
* should keep track of namespace across portals (complex)
* should unwind namespaces on uncaught errors
* should unwind namespaces on caught errors
* should unwind namespaces on caught errors in a portal
* should pass portal context when rendering subtree elsewhere
* should update portal context if it changes due to setState
* should update portal context if it changes due to re-render
@@ -400,6 +400,19 @@ describe('ReactDOMFiber', () => {
});
it('should keep track of namespace across portals (medium)', () => {
assertNamespacesMatch(
<svg {...expectSVG}>
<image {...expectSVG} />
{usePortal(
<div {...expectHTML} />
)}
<image {...expectSVG} />
{usePortal(
<div {...expectHTML} />
)}
<image {...expectSVG} />
</svg>
);
assertNamespacesMatch(
<div {...expectHTML}>
<math {...expectMath}>
@@ -613,15 +626,9 @@ describe('ReactDOMFiber', () => {
</div>
)}
</ErrorBoundary>
{
/*
* TODO: enable. Currently this leads to stack overflow
* but it might be a bug in error boundaries rather than SVG or portals.
usePortal(
<div {...expectHTML} />
)
*/
}
{usePortal(
<div {...expectHTML} />
)}
</svg>
);
});