Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix Suspense only rendering the first child
Browse files Browse the repository at this point in the history
Closes #34
  • Loading branch information
wojtekmaj committed Nov 4, 2022
1 parent 4dcd4e2 commit a2507a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ReactSeventeenAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function toTree(vnode) {
case FiberTags.Lazy:
return childrenToTree(node.child);
case FiberTags.OffscreenComponent:
return toTree(node.child);
return childrenToTree(node.child);
default:
throw new Error(`Enzyme Internal Error: unknown node with tag ${node.tag}`);
}
Expand Down
3 changes: 1 addition & 2 deletions test/test/ReactWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,7 @@ describe('mount', () => {
expect(wrapper.find(Fallback)).to.have.lengthOf(0);
});

// FIXME: Fails for @wojtekmaj/enzyme-adapter-react-17
it.skip('works with Suspense with multiple children', () => {
it('works with Suspense with multiple children', () => {
const SuspenseComponent = () => (
<Suspense fallback={<Fallback />}>
<div />
Expand Down

0 comments on commit a2507a7

Please sign in to comment.