bill icon indicating copy to clipboard operation
bill copied to clipboard

does this work with react-test-renderer AND react-addons-test-utils ?

Open faceyspacey opened this issue 9 years ago • 0 comments

I.e. does it work with the component tree's meant for serialization/snapshots:

import renderer from 'react-test-renderer'
import { querySelectorAll } from 'bill'

const tree = renderer.create(<div />).toJSON()
const matches = querySelectorAll('div', tree)
import ReactTestUtils from 'react-addons-test-utils'
import { querySelectorAll } from 'bill'

const renderer = ReactTestUtils.createRenderer()
renderer.render(<div />)

const tree = renderer.getRenderOutput()
const matches = querySelectorAll('div', tree)

The reason I ask is because you may have already created a component instance with renderer.create() which continues to stay reactively "alive" responding to state changes, and then you want to traverse its component tree, not the original component tree you first passed to renderer.create().

I'd like to add *Bill` to this library of mine:

https://github.com/faceyspacey/jest-redux-snap

So, for example, will bill be able to work with renderer.create(<div />).toJSON()?

faceyspacey avatar Mar 02 '17 15:03 faceyspacey