Skip to content

Bug in scryRenderedComponentsWithType #11855

@pronebird

Description

@pronebird

scryRenderedComponentsWithType spits the following:

findAllInRenderedTree(...): instance must be a composite component

test case:

class Accordion extends React.Component {
  render() {
    return (<div>{ this.props.children }</div>);
  }
}
const tree = ReactTestUtils.renderIntoDocument(
      <div>
        <Accordion height={ 0 }>
          <div>Hello</div>
        </Accordion>
      </div>
);

const elements = ReactTestUtils.scryRenderedComponentsWithType(tree, Accordion);
expect(elements[0].clientHeight).to.be.equal(0);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions