diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-09-25 11:32:46 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-09-25 15:22:45 +0200 |
| commit | 7ad09bb75de84957a70014c9e4aa90f4c624a2da (patch) | |
| tree | acad5ea45c6ce3a34d8a2bf6bc76d3e2569a0d30 | |
| parent | 6ffac7518b1c19cbaa19800456134cc769891783 (diff) | |
| download | mullvadvpn-7ad09bb75de84957a70014c9e4aa90f4c624a2da.tar.xz mullvadvpn-7ad09bb75de84957a70014c9e4aa90f4c624a2da.zip | |
Read the city and coutry from the temporary config until we implement it in the backend
| -rw-r--r-- | app/components/Connect.js | 2 | ||||
| -rw-r--r-- | test/components/Connect.spec.js | 24 |
2 files changed, 19 insertions, 7 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js index 66696fef64..a5af9250f7 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -109,7 +109,7 @@ export default class Connect extends Component { case 'disconnected': isDisconnected = true; break; } - const { city, country } = this.props.connection; + const { city, country } = serverInfo; // We decided to not include the map in the first beta release to customers // but it MUST be included in the following releases. Therefore we choose diff --git a/test/components/Connect.spec.js b/test/components/Connect.spec.js index 30228fc4c6..e116311e42 100644 --- a/test/components/Connect.spec.js +++ b/test/components/Connect.spec.js @@ -36,9 +36,15 @@ describe('components/Connect', () => { }); it('shows the connection location information when connected', () => { - const component = renderConnected({}, { - country: 'sweden', - city: 'gothenburg', + const component = renderConnected({ + getServerInfo: (_s) => ({ + address: '', + name: '', + location: [0, 0], + country: 'sweden', + city: 'gothenburg', + }), + }, { clientIp: '1.2.3.4', }); const countryAndCity = component.find('.connect__status-location'); @@ -50,9 +56,15 @@ describe('components/Connect', () => { }); it('shows the connection location information when disconnected', () => { - const component = renderNotConnected({}, { - country: 'sweden', - city: 'gothenburg', + const component = renderNotConnected({ + getServerInfo: (_s) => ({ + address: '', + name: '', + location: [0, 0], + country: 'sweden', + city: 'gothenburg', + }), + }, { clientIp: '1.2.3.4', }); const countryAndCity = component.find('.connect__status-location'); |
