1
したがって、還元型と酵素を使っている間に自分のコンポーネントにテストを書こうとしています。 はこれまでのところ、私の簡単な部品のために、私は、問題は、私が反応し-Reduxのをだけでなく、それが失敗した使用しようとしているときということで、以下の機能一般的な機能を使って酵素で還元型をテストする
export const mountWithContext = (node, store) => {
const nodeToMount = store ? <Provider store={store} >{node}</Provider> : node;
return mount(nodeToMount);
};
を作成しました。 がやろうとしている。
class Form extends Component {
render() {
return <div><TestComponent /></div>
}
}
const TestForm = reduxForm({ form: 'testForm' })(Form);
const enzymeWrapper = mountWithContext(TestForm, store)
と私は次のエラー
'Warning: Failed prop type: Invalid prop `children` of type `function` supplied to `Provider`, expected a single ReactElement.
Invariant Violation: React.Children.only expected to receive a single React element child.
にこの問題が発生し、これを解決する方法を、なぜすべてのアイデアを取得していますか?