diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-06-01 16:13:10 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-06-05 12:11:55 +0200 |
| commit | ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087 (patch) | |
| tree | b1f7754eb50896ab3681e35fa4e08be642b940c9 /test/logout.spec.js | |
| parent | 5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff) | |
| download | mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip | |
Add formatted source code
Diffstat (limited to 'test/logout.spec.js')
| -rw-r--r-- | test/logout.spec.js | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/test/logout.spec.js b/test/logout.spec.js index 0e295aef9b..c7ed45adb2 100644 --- a/test/logout.spec.js +++ b/test/logout.spec.js @@ -1,35 +1,41 @@ // @flow import { expect } from 'chai'; -import { setupBackendAndStore, setupBackendAndMockStore, getLocation, checkNextTick, failFastNextTick } from './helpers/ipc-helpers'; +import { + setupBackendAndStore, + setupBackendAndMockStore, + getLocation, + checkNextTick, + failFastNextTick, +} from './helpers/ipc-helpers'; import { IpcChain } from './helpers/IpcChain'; import accountActions from '../app/redux/account/actions'; describe('logging out', () => { - it('should set the account to null and then disconnect', (done) => { const { mockIpc, backend } = setupBackendAndStore(); const chain = new IpcChain(mockIpc); - chain.require('setAccount') + chain + .require('setAccount') .withInputValidation((num) => { expect(num).to.be.null; }) .done(); - chain.require('disconnect') - .done(); + chain.require('disconnect').done(); chain.onSuccessOrFailure(done); backend.logout(); }); - it('should remove the account number from the store', (done) => { - const { store, backend, mockIpc } = setupBackendAndStore(); - mockIpc.getAccountData = () => new Promise(r => r({ - expiry: '2001-01-01T00:00:00.000Z', - })); + mockIpc.getAccountData = () => + new Promise((r) => + r({ + expiry: '2001-01-01T00:00:00.000Z', + }), + ); const action: any = accountActions.login(backend, '123'); store.dispatch(action); @@ -53,7 +59,6 @@ describe('logging out', () => { }, done); }); - it('should redirect to / on logout', (done) => { const { store, backend } = setupBackendAndMockStore(); |
