Skip to content

Tests: toTree on a rendered array #10616

@porfirioribeiro

Description

@porfirioribeiro

I don't know if this is a bug or if i am doing it wrong,
When i have a component that the render returns an array in Fiber, the rendered returns only the first element

const Wrap = ({ children }) => children;

describe('Test', () => {

    it('renders 2 div', () => {
        const rendered = ReactTestRenderer.create(
            <Wrap>
                <div>One</div>
                <div>Two</div>
            </Wrap>
        );
        console.log(rendered.toTree().rendered);
    })
})

What is the current behavior?
Log's only the first element

What is the expected behavior?
I think this should be an array of elements

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions