Niezmienne naruszenie: Nie można znaleźć słowa „store” ani w kontekście, ani w rekwizytach słowa „Connect (IndexResult)”. Zawiń komponent główny w lub zapisz jawnie „store” jako propozycję dla „Connect (IndexResult)”.
Otrzymuję ten błąd, gdy próbuję użyć mount
const wrapper = mount ();
Odpowiedzi:
1 dla odpowiedzi № 1Utwórz tę funkcję:
export const wrapIntoReduxProvider = testingContainerComponent => (
<Provider store={organizationStore({})}>
{testingContainerComponent}
</Provider>
);
i zawiń w nią swój komponent
const wrapper = mount(wrapIntoReduxProvider(<YourComponent />));