diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-01-11 14:11:03 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-01-11 14:19:01 +0100 |
| commit | bc0a8defa9a04a750672b7370a75a25d9dcb3788 (patch) | |
| tree | 4bd487421c4f19144687c20952768abbdf8531b2 | |
| parent | 2bbd9f41410ede1532793ff701471927e11da698 (diff) | |
| download | mullvadvpn-bc0a8defa9a04a750672b7370a75a25d9dcb3788.tar.xz mullvadvpn-bc0a8defa9a04a750672b7370a75a25d9dcb3788.zip | |
Remove the SelectLocation tests
I don't know what we were testing here.
| -rw-r--r-- | gui/packages/desktop/test/components/SelectLocation.spec.js | 142 |
1 files changed, 0 insertions, 142 deletions
diff --git a/gui/packages/desktop/test/components/SelectLocation.spec.js b/gui/packages/desktop/test/components/SelectLocation.spec.js deleted file mode 100644 index b8bb8991c8..0000000000 --- a/gui/packages/desktop/test/components/SelectLocation.spec.js +++ /dev/null @@ -1,142 +0,0 @@ -// @flow - -import * as React from 'react'; -import { shallow } from 'enzyme'; -import { CloseBarItem } from '../../src/renderer/components/NavigationBar'; -import SelectLocation from '../../src/renderer/components/SelectLocation'; - -describe('components/SelectLocation', () => { - const defaultProps = { - relaySettings: { - normal: { - location: 'any', - protocol: 'any', - port: 'any', - }, - }, - relayLocations: [ - { - name: 'Sweden', - code: 'se', - hasActiveRelays: true, - cities: [ - { - name: 'Malmö', - code: 'mma', - latitude: 0, - longitude: 0, - hasActiveRelays: true, - relays: [ - { - hostname: 'fake1.mullvad.net', - ipv4AddrIn: '192.168.0.100', - includeInCountry: true, - weight: 1, - }, - { - hostname: 'fake2.mullvad.net', - ipv4AddrIn: '192.168.0.101', - includeInCountry: true, - weight: 1, - }, - ], - }, - { - name: 'Stockholm', - code: 'sto', - latitude: 0, - longitude: 0, - hasActiveRelays: true, - relays: [ - { - hostname: 'fake2.mullvad.net', - ipv4AddrIn: '192.168.0.101', - includeInCountry: true, - weight: 1, - }, - ], - }, - ], - }, - ], - }; - - it('should call close callback', (done) => { - const props = { - ...defaultProps, - onClose: () => done(), - onSelect: () => {}, - }; - const component = shallow(<SelectLocation {...props} />) - .find(CloseBarItem) - .dive(); - component.simulate('press'); - }); - - it('should call select callback for country', (done) => { - const props = { - ...defaultProps, - onClose: () => {}, - onSelect: (location) => { - try { - expect(location).to.deep.equal({ - country: 'se', - }); - done(); - } catch (e) { - done(e); - } - }, - }; - const component = shallow(<SelectLocation {...props} />); - const elements = getComponent(component, 'country'); - expect(elements).to.have.length(1); - elements.at(0).simulate('press'); - }); - - it('should call select callback for city', (done) => { - const props = { - ...defaultProps, - onClose: () => {}, - onSelect: (location) => { - try { - expect(location).to.deep.equal({ - city: ['se', 'mma'], - }); - done(); - } catch (e) { - done(e); - } - }, - }; - const component = shallow(<SelectLocation {...props} />); - const elements = getComponent(component, 'city'); - expect(elements).to.have.length(2); - elements.at(0).simulate('press'); - }); - - it('should call select callback for relay', (done) => { - const props = { - ...defaultProps, - onClose: () => {}, - onSelect: (location) => { - try { - expect(location).to.deep.equal({ - hostname: ['se', 'mma', 'fake1.mullvad.net'], - }); - done(); - } catch (e) { - done(e); - } - }, - }; - const component = shallow(<SelectLocation {...props} />); - const elements = getComponent(component, 'relay'); - expect(elements).to.have.length(2); - elements.at(0).simulate('press'); - }); -}); - -function getComponent(container, testName) { - return container.findWhere((n) => n.prop('testName') === testName); -} |
