Tests for the saga, AsyncActionType, and profile actions.

Also changing the way the saga gets ahold of the UserAccountApiService to make it more testable.
This commit is contained in:
David Joy
2019-02-14 16:07:53 -05:00
committed by David Joy
parent bd9750fc58
commit 2e63b87aba
6 changed files with 171 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ import createSagaMiddleware from 'redux-saga';
import thunkMiddleware from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';
import { createLogger } from 'redux-logger';
import { UserAccountApiService } from '@edx/frontend-auth';
import apiClient from './apiClient';
import reducers from './reducers/RootReducer';
@@ -17,6 +18,9 @@ const store = createStore(
composeWithDevTools(applyMiddleware(thunkMiddleware, sagaMiddleware, loggerMiddleware)),
);
sagaMiddleware.run(rootSaga);
const apiService = new UserAccountApiService(apiClient, process.env.LMS_BASE_URL);
apiService.saveUserAccount = apiService.saveUserAccount.bind(apiService);
sagaMiddleware.run(rootSaga, apiService);
export default store;