Created
May 13, 2017 09:54
-
-
Save faisal00813/7700453da95d08884a1ce01a50c50574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import thunk from 'redux-thunk'; | |
import expect from 'expect'; | |
describe('actions test', () => { | |
beforeAll(() => { | |
// do something here which you want to be executed before first test runs | |
} | |
it('editor.newPatient() should create a new patient', (done) => { | |
const dispatch = expect.createSpy(); | |
const patient = { | |
_id: new Date().getTime() + '_' + "" + '_' + "", | |
type: "hosp_patient", | |
visitedOn: new Date().getTime(), | |
mobile:"XXXXXXXXXXXXX", | |
firstName:"YYYYY" | |
}; | |
editor.newPatient(patient,db)(dispatch).then(()=>{ | |
expect(dispatch.calls[1].arguments[0].type).toBe('START_NEW_ACCOUNT'); | |
done(); | |
}).catch((err)=>{ | |
console.log(err); | |
done(); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment