File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,25 +5,16 @@ import chaiEnzyme from 'chai-enzyme'
55chai . use ( chaiEnzyme ( ) )
66
77import Root from '../../src/components/root.jsx'
8+ import makeStore from '../../src/store'
89
9- // this fails with:
10- // Invariant Violation: Could not find "store" in either the context or props of
11- // "Connect(Counter)". Either wrap the root component in a <Provider>, or
12- // explicitly pass "store" as a prop to "Connect(Counter)".
10+ const store = makeStore ( )
11+ let output
1312
14- const output = shallow ( < Root /> )
15-
16- // FWIW, this also fails with the same error:
13+ exports [ '<Root />' ] = {
1714
18- // import { Provider } from 'react-redux'
19- // import makeStore from '../../src/store'
20- // const store = makeStore()
21- // const output = shallow(
22- // <Provider store={store} >
23- // <Root />
24- // </Provider>
25- // )
15+ before : ( ) => {
16+ output = shallow ( < Root /> , { context : { store } } )
17+ } ,
2618
27- exports [ '<Root />' ] = {
2819 'is a <div>' : ( ) => expect ( output ) . to . have . tagName ( 'div' ) ,
2920}
You can’t perform that action at this time.
0 commit comments