summaryrefslogtreecommitdiffhomepage
path: root/test/components
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-11-01 07:33:17 +0100
committerErik Larkö <erik@mullvad.net>2017-11-08 15:21:06 +0100
commita77e01a50b165fd8d6e2db96652a1fcc9a220723 (patch)
tree4866f64a6956f1cfc2a4a47f7dac792af3b07a47 /test/components
parente53e809b9b674e70dc1f540ed25076ca5bc6fae2 (diff)
downloadmullvadvpn-a77e01a50b165fd8d6e2db96652a1fcc9a220723.tar.xz
mullvadvpn-a77e01a50b165fd8d6e2db96652a1fcc9a220723.zip
tcp and port
Diffstat (limited to 'test/components')
-rw-r--r--test/components/Connect.spec.js16
-rw-r--r--test/components/SelectLocation.spec.js10
-rw-r--r--test/components/Settings.spec.js10
3 files changed, 29 insertions, 7 deletions
diff --git a/test/components/Connect.spec.js b/test/components/Connect.spec.js
index 07c67a57bc..5c342bff12 100644
--- a/test/components/Connect.spec.js
+++ b/test/components/Connect.spec.js
@@ -106,7 +106,11 @@ describe('components/Connect', () => {
const locationSwitcher = component.find('.connect__server');
component.setProps({
- preferredServer: 'se1.mullvad.net',
+ settings: {
+ relayConstraints: {
+ host: { only: 'se1.mullvad.net' },
+ },
+ },
});
expect(locationSwitcher.text()).to.contain(servers['se1.mullvad.net'].name);
});
@@ -181,6 +185,14 @@ const defaultProps = {
getServerInfo: (_) => { return defaultServer; },
accountExpiry: '',
- preferredServer: '',
+ settings: {
+ relayConstraints: {
+ host: { only: 'www.example.com' },
+ tunnel: { openvpn: {
+ port: 'any',
+ protocol: 'any',
+ }},
+ },
+ },
connection: defaultConnection,
};
diff --git a/test/components/SelectLocation.spec.js b/test/components/SelectLocation.spec.js
index 783a3adbf9..a3565a6704 100644
--- a/test/components/SelectLocation.spec.js
+++ b/test/components/SelectLocation.spec.js
@@ -4,15 +4,19 @@ import { expect } from 'chai';
import React from 'react';
import ReactTestUtils, { Simulate } from 'react-dom/test-utils';
import SelectLocation from '../../app/components/SelectLocation';
-import { defaultServer } from '../../app/config';
import type { SettingsReduxState } from '../../app/redux/settings/reducers';
import type { SelectLocationProps } from '../../app/components/SelectLocation';
describe('components/SelectLocation', () => {
const state: SettingsReduxState = {
- autoSecure: true,
- preferredServer: defaultServer
+ relayConstraints: {
+ host: 'any',
+ tunnel: { openvpn: {
+ port: 'any',
+ protocol: 'any',
+ }},
+ },
};
const makeProps = (state: SettingsReduxState, mergeProps: $Shape<SelectLocationProps>): SelectLocationProps => {
diff --git a/test/components/Settings.spec.js b/test/components/Settings.spec.js
index f90d658f9b..2f562051b5 100644
--- a/test/components/Settings.spec.js
+++ b/test/components/Settings.spec.js
@@ -4,7 +4,6 @@ import { expect } from 'chai';
import React from 'react';
import ReactTestUtils, { Simulate } from 'react-dom/test-utils';
import Settings from '../../app/components/Settings';
-import { defaultServer } from '../../app/config';
import type { AccountReduxState } from '../../app/redux/account/reducers';
import type { SettingsReduxState } from '../../app/redux/settings/reducers';
@@ -33,7 +32,13 @@ describe('components/Settings', () => {
};
const settingsState: SettingsReduxState = {
- preferredServer: defaultServer
+ relayConstraints: {
+ host: 'any',
+ tunnel: { openvpn: {
+ port: 'any',
+ protocol: 'any',
+ }},
+ },
};
const makeProps = (anAccountState: AccountReduxState, aSettingsState: SettingsReduxState, mergeProps: $Shape<SettingsProps> = {}): SettingsProps => {
@@ -44,6 +49,7 @@ describe('components/Settings', () => {
onClose: () => {},
onViewAccount: () => {},
onViewSupport: () => {},
+ onViewAdvancedSettings: () => {},
onExternalLink: (_type) => {}
};
return Object.assign({}, defaultProps, mergeProps);