summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-02-14 11:14:00 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-02-14 11:14:00 +0000
commitedec4f2dc254d70c970f87608de2cbeba86288e0 (patch)
treefeff3c2174592ce7152c52021a7baeda01130264 /test
parent6aa0b0441dc1e58bd296ec99e3f5cff31556468d (diff)
downloadmullvadvpn-edec4f2dc254d70c970f87608de2cbeba86288e0.tar.xz
mullvadvpn-edec4f2dc254d70c970f87608de2cbeba86288e0.zip
Add test for USER_LOGIN_CHANGE reducer
Diffstat (limited to 'test')
-rw-r--r--test/reducers/user.spec.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/reducers/user.spec.js b/test/reducers/user.spec.js
index cd06ae07d8..bd133f5f4b 100644
--- a/test/reducers/user.spec.js
+++ b/test/reducers/user.spec.js
@@ -1,21 +1,23 @@
import { expect } from 'chai';
import reducer from '../../app/reducers/user';
+import { LoginState } from '../../app/constants';
describe('reducers', () => {
describe('user', () => {
- // it('should handle USER_LOGIN', () => {
- // const action = {
- // type: 'USER_LOGIN',
- // payload: {
- // username: 'John Doe',
- // loggedIn: true
- // }
- // };
- // const test = Object.assign({}, action.payload);
- // expect(reducer({}, action)).to.deep.equal(test);
- // });
+ it('should handle USER_LOGIN_CHANGE', () => {
+ const action = {
+ type: 'USER_LOGIN_CHANGE',
+ payload: {
+ account: '1111',
+ status: LoginState.failed,
+ error: new Error('Something went wrong')
+ }
+ };
+ const test = Object.assign({}, action.payload);
+ expect(reducer({}, action)).to.deep.equal(test);
+ });
});