Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions test/components/root.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ import chaiEnzyme from 'chai-enzyme'
chai.use(chaiEnzyme())

import Root from '../../src/components/root.jsx'
import makeStore from '../../src/store'

const store = makeStore()
let output
// this fails with:
// Invariant Violation: Could not find "store" in either the context or props of
// "Connect(Counter)". Either wrap the root component in a <Provider>, or
// explicitly pass "store" as a prop to "Connect(Counter)".

exports['<Root />'] = {
const output = shallow(<Root />)

// FWIW, this also fails with the same error:

before: () => {
output = shallow(<Root />, { context: { store } })
},
// import { Provider } from 'react-redux'
// import makeStore from '../../src/store'
// const store = makeStore()
// const output = shallow(
// <Provider store={store} >
// <Root />
// </Provider>
// )

'is a <div>': () => expect(output).to.have.tagName('div'),
exports['<Root />'] = {
'is a <div>': () => expect(output.type()).to.equal('div'),
}