Last active
January 5, 2017 19:44
-
-
Save nickbalestra/de7915cf453e0a13467cf35ec66e9745 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 reducer, { types, actions, cycle } from './user' | |
describe('actions', () => { | |
// snapshot tests | |
it('should export specific action types', () => { | |
expect(types).toMatchSnapshot() | |
}) | |
it('should export specific action creators', () => { | |
expect(actions).toMatchSnapshot() | |
}) | |
// unit tests | |
it('should create an action to set the email', () => { | |
const email = '[email protected]' | |
const expectedAction = { | |
type: types.SET_EMAIL, | |
payload: email | |
} | |
expect(actions.setEmail(email)).toEqual(expectedAction) | |
}) | |
it('should create an action to set the password', () => { | |
const password = '1234' | |
const expectedAction = { | |
type: types.SET_PASSWORD, | |
payload: password | |
} | |
expect(actions.setPassword(password)).toEqual(expectedAction) | |
}) | |
}) | |
describe('reducer', () => { | |
// test the reducer as per : | |
// https://github.com/reactjs/redux/blob/master/docs/recipes/WritingTests.md | |
}) | |
describe('cycle', () => { | |
// test I/O of the exported cycle | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment