From 2bd6b2eac76d3d3a9f1ea2f4d84ab69733688067 Mon Sep 17 00:00:00 2001 From: Jesse McCarthy Date: Mon, 9 May 2016 14:31:35 -0400 Subject: [PATCH 1/2] Revert "update test with store context" This reverts commit fc2d9d3ad153689f5d8c20649d7ceb029bbfce5d. --- test/components/root.spec.jsx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/components/root.spec.jsx b/test/components/root.spec.jsx index 1f7beae..adcd702 100644 --- a/test/components/root.spec.jsx +++ b/test/components/root.spec.jsx @@ -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 , or +// explicitly pass "store" as a prop to "Connect(Counter)". -exports[''] = { +const output = shallow() + +// FWIW, this also fails with the same error: - before: () => { - output = shallow(, { context: { store } }) - }, +// import { Provider } from 'react-redux' +// import makeStore from '../../src/store' +// const store = makeStore() +// const output = shallow( +// +// +// +// ) +exports[''] = { 'is a
': () => expect(output).to.have.tagName('div'), } From d93b51d58bb515c3050de7d5d3a515e7d996b443 Mon Sep 17 00:00:00 2001 From: Jesse McCarthy Date: Mon, 9 May 2016 14:36:45 -0400 Subject: [PATCH 2/2] Fix test broken by chai-enzyme See https://github.com/producthunt/chai-enzyme/issues/13 --- test/components/root.spec.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/root.spec.jsx b/test/components/root.spec.jsx index adcd702..128d44a 100644 --- a/test/components/root.spec.jsx +++ b/test/components/root.spec.jsx @@ -25,5 +25,5 @@ const output = shallow() // ) exports[''] = { - 'is a
': () => expect(output).to.have.tagName('div'), + 'is a
': () => expect(output.type()).to.equal('div'), }