Я пытаюсь протестировать связанный компонент (реакция-редукция) с помощью jest-энзима. Я использую магазин response-redux-mock. Когда я запускаю свой тест, чтобы найти один div в компоненте, он дает мне эту ошибку.
Invariant Violation: Passing redux store in props has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React-Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect
Я смонтировал и протестировал только компонент без редукции, он работает, но я хочу провести неглубокий тест.
describe("Input Component", () => {
let wrapper;
let store;
beforeEach(() => {
store = mockStore(initialState);
wrapper = shallow(<Input store={store} />);
});
it("should rendder without error", () => {
expect(wrapper.find("div")).toHaveLength(1);
});
});