diff options
| -rw-r--r-- | app/lib/backend.js | 2 | ||||
| -rw-r--r-- | test/autologin.spec.js | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index 6aec66e208..4cdb425824 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -207,6 +207,8 @@ export class Backend { this._store.dispatch(accountActions.autoLoginFailed()); this._store.dispatch(push('/')); + + throw e; }); } 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; |
