diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-07-28 07:33:29 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-07-28 07:33:29 +0200 |
| commit | a196629083e1fb634a1d65e816a1b4bdfbdeb072 (patch) | |
| tree | 7f2f9b8ae3f2c2927345b31c86465464b538e923 /test | |
| parent | fd803f74404a1a10f290cbd0852c4ee9a1b2d7ae (diff) | |
| parent | 8df67c161683773092668130deec3f50c23b9205 (diff) | |
| download | mullvadvpn-a196629083e1fb634a1d65e816a1b4bdfbdeb072.tar.xz mullvadvpn-a196629083e1fb634a1d65e816a1b4bdfbdeb072.zip | |
Merge branch 'new-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'); + }); +}); |
