summaryrefslogtreecommitdiffhomepage
path: root/test/actions
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-02-14 12:03:15 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-02-14 12:03:15 +0000
commitd9725c147e491d539417b9441ea4785806ab9f66 (patch)
tree083776a402e4120019a3de6a185841dc54486dc7 /test/actions
parentedec4f2dc254d70c970f87608de2cbeba86288e0 (diff)
downloadmullvadvpn-d9725c147e491d539417b9441ea4785806ab9f66.tar.xz
mullvadvpn-d9725c147e491d539417b9441ea4785806ab9f66.zip
Refactor code and implement missing tests
Diffstat (limited to 'test/actions')
-rw-r--r--test/actions/user.spec.js24
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);
+ });
});
});