Skip to content

Commit

Permalink
Fix profiler being flattened in mounted tree
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 5, 2019
1 parent a89a40f commit 5b4a309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -206,8 +206,8 @@ function toTree(vnode) {
case FiberTags.Mode:
case FiberTags.ContextProvider:
case FiberTags.ContextConsumer:
case FiberTags.Profiler:
return childrenToTree(node.child);
case FiberTags.Profiler:
case FiberTags.ForwardRef: {
return {
nodeType: 'function',
Expand Down
8 changes: 5 additions & 3 deletions packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Expand Up @@ -784,9 +784,11 @@ describeWithDOM('mount', () => {
it('renders', () => {
const wrapper = mount(<SomeComponent />);
expect(wrapper.debug()).to.equal(`<SomeComponent>
<main>
<div className="child" />
</main>
<Profiler id="SomeComponent" onRender={[Function: onRender]}>
<main>
<div className="child" />
</main>
</Profiler>
</SomeComponent>`);
});

Expand Down

0 comments on commit 5b4a309

Please sign in to comment.