diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-14 12:03:15 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-14 12:03:15 +0000 |
| commit | d9725c147e491d539417b9441ea4785806ab9f66 (patch) | |
| tree | 083776a402e4120019a3de6a185841dc54486dc7 /test/actions | |
| parent | edec4f2dc254d70c970f87608de2cbeba86288e0 (diff) | |
| download | mullvadvpn-d9725c147e491d539417b9441ea4785806ab9f66.tar.xz mullvadvpn-d9725c147e491d539417b9441ea4785806ab9f66.zip | |
Refactor code and implement missing tests
Diffstat (limited to 'test/actions')
| -rw-r--r-- | test/actions/user.spec.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/actions/user.spec.js b/test/actions/user.spec.js index cc4080edc7..91f0b8b125 100644 --- a/test/actions/user.spec.js +++ b/test/actions/user.spec.js @@ -1,21 +1,23 @@ import { expect } from 'chai'; import actions from '../../app/actions/user'; +import { LoginState } from '../../app/constants'; describe('actions', () => { describe('user', () => { - // it('should log in', () => { - // const action = { - // type: 'USER_LOGIN', - // payload: { - // username: 'John Doe', - // loggedIn: true - // } - // }; - // const payload = Object.assign({}, action.payload); - // expect(actions.login(payload)).to.deep.equal(action); - // }); + it('should create action for USER_LOGIN_CHANGE', () => { + const test = { + type: actions.loginChange.toString(), + payload: { + account: '1111', + status: LoginState.failed, + error: new Error('Something went wrong') + } + }; + const payload = Object.assign({}, test.payload); + expect(actions.loginChange(payload)).to.deep.equal(test); + }); }); }); |
