showing results for - "jest mock react redux hooks"
Lola
08 Jul 2018
1import React from 'react';
2import {Provider} from 'react-redux'
3import { mount, shallow } from 'enzyme'
4import configureMockStore from 'redux-mock-store'
5import thunk from 'redux-thunk';
6import App from '../App';
7
8const mockStore = configureMockStore([thunk]);
9
10describe('App', () => {
11  it('should render a startup component if startup is not complete', () => {
12    const store = mockStore({
13      startup: { complete: false }
14    });
15    const wrapper = mount(
16      <Provider store={store}>
17        <App />
18      </Provider>
19    )
20    expect(wrapper.find('Startup').length).toEqual(1)
21  })
22})
23