From 0af08cc575c649469db543b8edd7fcbe45b3a0bb Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Mon, 5 Mar 2018 11:34:06 -0500 Subject: [PATCH] use children to tree --- .../src/ReactSixteenAdapter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js b/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js index 6adae5eac..bcc1f48aa 100644 --- a/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js +++ b/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js @@ -29,6 +29,7 @@ const FunctionalComponent = 1; const HostPortal = 4; const HostComponent = 5; const HostText = 6; +const Mode = 11; const ContextConsumer = 12; const ContextProvider = 13; @@ -74,10 +75,6 @@ function toTree(vnode) { return toTree(node.child); case HostPortal: // 4 return toTree(node.child); - case ContextProvider: - return toTree(node.child); - case ContextConsumer: - return toTree(node.child); case ClassComponent: return { nodeType: 'class', @@ -88,8 +85,6 @@ function toTree(vnode) { instance: node.stateNode, rendered: childrenToTree(node.child), }; - case Fragment: // 10 - return childrenToTree(node.child); case FunctionalComponent: // 1 return { nodeType: 'function', @@ -117,6 +112,11 @@ function toTree(vnode) { } case HostText: // 6 return node.memoizedProps; + case Fragment: // 10 + case Mode: // 11 + case ContextProvider: // 13 + case ContextConsumer: // 12 + return childrenToTree(node.child); default: throw new Error(`Enzyme Internal Error: unknown node with tag ${node.tag}`); }