glenjamin / skin-deep

Test assertion helpers for use with React's shallowRender test utils
MIT License
200 stars 40 forks source link

Added dive() #29

Closed hoegrammer closed 8 years ago

hoegrammer commented 8 years ago

and tests. However, could not work out how to test that the context parameter is utilised correctly

closes #20

glenjamin commented 8 years ago

LGTM, perhaps expandSubTree as the name, so it's more clearly an action? Did anyone else weigh in on the name?

To test the context thing, you'd need to add contextTypes to a child, and childContextTypes + getChildContext to a parent.

glenjamin commented 8 years ago

Latest plan is to call this .dive() I think?

hoegrammer commented 8 years ago

Yes.

I wonder what happens when there are multiple subcomponents of same type

glenjamin commented 8 years ago

Oh, good point. Might need a more expressive API for selecting the component to dive into.

hoegrammer commented 8 years ago

Decision made to traverse first component in lists rather than trying to return all or specify (for now, anyway)