1
votes

Invariant Violation: Could not find "store" in either the context or props of "Connect(IndexResult)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(IndexResult)".

Getting this error when I try to use mount

const wrapper = mount();

1
Show more code how to ask - Nagaraj Tantri

1 Answers

1
votes

Create this function:

export const wrapIntoReduxProvider = testingContainerComponent => (
    <Provider store={organizationStore({})}>
        {testingContainerComponent}
    </Provider>
);

and wrap your component into it

const wrapper = mount(wrapIntoReduxProvider(<YourComponent />));