Skip to content

Commit

Permalink
Fix issues that were causing async action creators to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
GordyD committed Apr 23, 2016
1 parent 03d3d95 commit 929b8d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/redux/actions/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ export function setupDataStorage(api, patient) {
dispatch(sync.setupDataStorageRequest());

api.patient.post(patient, (err, createdPatient) => {
err = { status: 400, message: 'Messed up!' };
if (err) {
dispatch(sync.setupDataStorageFailure(
createActionError(ErrorMessages.ERR_DSA_SETUP, err), err
Expand Down
6 changes: 3 additions & 3 deletions test/unit/redux/actions/async.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('Actions', () => {

let expectedActions = [
{ type: 'CONFIRM_SIGNUP_REQUEST' },
{ type: 'CONFIRM_SIGNUP_FAILURE', error: err, meta: { apiError: {status: 500, body: 'Error!'} } }
{ type: 'CONFIRM_SIGNUP_FAILURE', error: err, payload: { signupKey: 'fakeSignupKey' }, meta: { apiError: {status: 500, body: 'Error!'} } }
];
_.each(expectedActions, (action) => {
expect(isTSA(action)).to.be.true;
Expand Down Expand Up @@ -172,8 +172,8 @@ describe('Actions', () => {

let expectedActions = [
{ type: 'CONFIRM_SIGNUP_REQUEST' },
{ type: 'CONFIRM_SIGNUP_FAILURE', error: err, meta: { apiError: {status: 400, message: 'User does not have a password'} } },
{ type: '@@router/TRANSITION', payload: { args: [ '/verification-with-password' ], method: 'push' } }
{ type: 'CONFIRM_SIGNUP_FAILURE', error: err, payload: { signupKey: 'fakeSignupKey' }, meta: { apiError: {status: 400, message: 'User does not have a password'} } },
{ type: '@@router/TRANSITION', payload: { args: [ '/verification-with-password?signupKey=fakeSignupKey' ], method: 'push' } }
];
_.each(expectedActions, (action) => {
expect(isTSA(action)).to.be.true;
Expand Down

0 comments on commit 929b8d8

Please sign in to comment.