refactor: Upgrade Redux (#11967)

* upgrade redux and react-redux, adjust types

* first round of test fixes

* fix rest of unit tests

* lint

Co-authored-by: Phillip Kelley-Dotson <pkelleydotson@yahoo.com>
This commit is contained in:
David Aaron Suddjian
2020-12-09 11:58:42 -08:00
committed by GitHub
parent 9121482479
commit 6270fa2026
41 changed files with 354 additions and 253 deletions

View File

@@ -17,9 +17,11 @@
* under the License.
*/
import React from 'react';
import * as ReactAll from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import sinon from 'sinon';
import { Subscription } from 'react-redux';
import { shallow } from 'enzyme';
import getInitialState from 'src/explore/reducers/getInitialState';
@@ -36,6 +38,13 @@ describe('ExploreViewContainer', () => {
let wrapper;
let isFeatureEnabledMock;
jest.spyOn(ReactAll, 'useContext').mockImplementation(() => {
return {
store,
subscription: new Subscription(store),
};
});
beforeAll(() => {
isFeatureEnabledMock = jest
.spyOn(featureFlags, 'isFeatureEnabled')
@@ -57,10 +66,11 @@ describe('ExploreViewContainer', () => {
});
beforeEach(() => {
wrapper = shallow(<ExploreViewContainer />, {
context: { store },
wrapper = shallow(<ExploreViewContainer store={store} />, {
disableLifecycleMethods: true,
}).dive();
})
.dive()
.dive();
});
it('renders', () => {