summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-09-27 15:25:32 +0200
committerErik Larkö <erik@mullvad.net>2017-09-27 16:50:07 +0200
commit03aa2fb993b2523d1b06c97d9effd95a6d550381 (patch)
tree91f7ae6139901869fe19740a64096a362efd3268 /test
parent99a3462a486e31e8fa093505a5ce748e573af98c (diff)
downloadmullvadvpn-03aa2fb993b2523d1b06c97d9effd95a6d550381.tar.xz
mullvadvpn-03aa2fb993b2523d1b06c97d9effd95a6d550381.zip
Don't autoconnect if the autologin fails
Diffstat (limited to 'test')
-rw-r--r--test/autologin.spec.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/autologin.spec.js b/test/autologin.spec.js
index 734e81d479..5821166eff 100644
--- a/test/autologin.spec.js
+++ b/test/autologin.spec.js
@@ -35,6 +35,11 @@ describe('autologin', () => {
return backend.autologin()
.then( () => {
expect(getLocation(store)).to.equal('/');
+ })
+ .catch( (e) => {
+ if (e !== 'NO_ACCOUNT') {
+ throw e;
+ }
});
});
@@ -42,11 +47,16 @@ describe('autologin', () => {
const { store, backend, mockIpc } = setupBackendAndMockStore();
mockIpc.getAccount = () => new Promise(r => r('123'));
- mockIpc.getAccountData = () => new Promise((_, reject) => reject('NO ACCOUNT'));
+ mockIpc.getAccountData = () => new Promise((_, reject) => reject('NO_ACCOUNT'));
return backend.autologin()
.then( () => {
expect(getLocation(store)).to.equal('/');
+ })
+ .catch( (e) => {
+ if (e !== 'NO_ACCOUNT') {
+ throw e;
+ }
});
});
@@ -56,6 +66,7 @@ describe('autologin', () => {
mockIpc.getAccount = () => new Promise(r => r(null));
return backend.autologin()
+ .catch( () => {}) // ignore errors
.then( () => {
const state = store.getState().account;
@@ -72,6 +83,7 @@ describe('autologin', () => {
mockIpc.getAccountData = () => new Promise((_, reject) => reject('NO ACCOUNT'));
return backend.autologin()
+ .catch( () => {}) // ignore errors
.then( () => {
const state = store.getState().account;