Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find utilities for tree component #1495

Closed
alansouzati opened this issue Aug 26, 2016 · 2 comments
Closed

Find utilities for tree component #1495

alansouzati opened this issue Aug 26, 2016 · 2 comments

Comments

@alansouzati
Copy link
Contributor

I have the following test with Jest

  const component = renderer.create(
      <Accordion>
        <AccordionPanel heading="First Title">
          <p>test</p>
        </AccordionPanel>
      </Accordion>
    );
    let tree = component.toJSON();

   // jest.findAll(tree, Header)
   // jest.findFirst(tree, Header)
   // ...

Is there a support for something like this? Basically I'm looking for some utility that will be able to find elements inside a given tree generated by the react list renderer.

Or even better, maybe jest can provide a renderer with support for that, something like:

  const component = jest.render(
      <Accordion>
        <AccordionPanel heading="First Title">
          <p>test</p>
        </AccordionPanel>
      </Accordion>
    );
    let tree = component.toJSON();

   // component.findAll(Header)
   // component.findFirst(Header)
   // ...
@cpojer
Copy link
Member

cpojer commented Aug 29, 2016

This is not yet supported. The issue tracking it is here: facebook/react#7148

@cpojer cpojer closed this as completed Aug 29, 2016
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants