percyhanna / rquery

A testing utility that provides React tree traversal similar to jQuery
MIT License
56 stars 9 forks source link

Doesn't work with shallow rendering #14

Closed cappslock closed 8 years ago

cappslock commented 9 years ago

I've tried using this on a component attained through shallow rendering, and though the initial $R(component) call seems to work, running a find() doesn't seem to work at all.

Is shallow rendering currently supported?

percyhanna commented 9 years ago

I have not tested shallow rendering yet. I'll check it out and let you know how it goes.

percyhanna commented 9 years ago

Hi Eric,

I've looked into it briefly, and it looks like it would be a slightly larger task. It seems the only output from the shallow renderer is the elements, rather than components. Currently rquery only works with components. The same information needed for running CSS-style selectors on the elements should all be available, however, it would require some work to handle both components and elements transparently.

I'm open to a PR if you're willing to try to tackle it, otherwise I'm not sure when I might be able to get around to working on it.

percyhanna commented 8 years ago

I realize this is from a long time ago, but I was in an rquery mood this weekend. Added support for shallow rendering in #29, released as version 4.1.0.