diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-07-25 10:30:36 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-07-28 07:29:41 +0200 |
| commit | 8df67c161683773092668130deec3f50c23b9205 (patch) | |
| tree | 7f2f9b8ae3f2c2927345b31c86465464b538e923 /test | |
| parent | fd803f74404a1a10f290cbd0852c4ee9a1b2d7ae (diff) | |
| download | mullvadvpn-8df67c161683773092668130deec3f50c23b9205.tar.xz mullvadvpn-8df67c161683773092668130deec3f50c23b9205.zip | |
Added NEW_PUBLIC_IP action
Diffstat (limited to 'test')
| -rw-r--r-- | test/connection-info.spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/connection-info.spec.js b/test/connection-info.spec.js new file mode 100644 index 0000000000..16600d4389 --- /dev/null +++ b/test/connection-info.spec.js @@ -0,0 +1,19 @@ +// @flow + +import { expect } from 'chai'; +import { createMemoryHistory } from 'history'; +import configureStore from '../app/redux/store'; +import connectionActions from '../app/redux/connection/actions'; + +describe('The connection state', () => { + + it('should contain the latest IP', () => { + const memoryHistory = createMemoryHistory(); + const store = configureStore(null, memoryHistory); + + store.dispatch(connectionActions.newPublicIp('1.2.3.4')); + store.dispatch(connectionActions.newPublicIp('5.6.7.8')); + + expect(store.getState().connection.clientIp).to.equal('5.6.7.8'); + }); +}); |
