diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/packages/desktop/test/components/SelectLocation.spec.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gui/packages/desktop/test/components/SelectLocation.spec.js b/gui/packages/desktop/test/components/SelectLocation.spec.js index 7ddc378257..f4aaf83ba1 100644 --- a/gui/packages/desktop/test/components/SelectLocation.spec.js +++ b/gui/packages/desktop/test/components/SelectLocation.spec.js @@ -34,6 +34,13 @@ describe('components/SelectLocation', () => { includeInCountry: true, weight: 1, }, + { + hostname: 'fake2.mullvad.net', + ipv4AddrIn: '192.168.0.101', + ipv4AddrExit: '192.168.1.101', + includeInCountry: true, + weight: 1, + }, ], }, { @@ -110,6 +117,27 @@ describe('components/SelectLocation', () => { 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) { |
