summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-01-15 11:10:59 +0100
committerAndrej Mihajlov <and@mullvad.net>2018-01-15 11:10:59 +0100
commitf0220158eaffde6ef59c6e387ebc66f0693b848c (patch)
tree1dbc9cd2ee8cdb6b4b68b2a66c437745fc87f80b
parent3da799eda3954d7629f65a92803c72f1c55b0a0e (diff)
parent2f9a4123b5fa2c42ad6efccb96c2e9df1dff9a42 (diff)
downloadmullvadvpn-f0220158eaffde6ef59c6e387ebc66f0693b848c.tar.xz
mullvadvpn-f0220158eaffde6ef59c6e387ebc66f0693b848c.zip
Merge branch 'select-location-design-review-fixes'
-rw-r--r--app/components/SelectLocation.js4
-rw-r--r--test/components/SelectLocation.spec.js7
2 files changed, 8 insertions, 3 deletions
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js
index 7fb124bf33..12cde94211 100644
--- a/app/components/SelectLocation.js
+++ b/app/components/SelectLocation.js
@@ -168,7 +168,7 @@ export default class SelectLocation extends Component {
</div>
</div>
- { relayCountry.hasActiveRelays && <button type="button" className="select-location__collapse-button" onClick={ handleCollapse }>
+ { relayCountry.cities.length > 1 && <button type="button" className="select-location__collapse-button" onClick={ handleCollapse }>
{ isExpanded ?
<ChevronUpSVG className="select-location__collapse-icon" /> :
<ChevronDownSVG className="select-location__collapse-icon" /> }
@@ -176,7 +176,7 @@ export default class SelectLocation extends Component {
</div>
- { relayCountry.hasActiveRelays && relayCountry.cities.length > 0 &&
+ { relayCountry.cities.length > 1 &&
(<Accordion className="select-location__cities" height={ isExpanded ? 'auto' : 0 }>
{ relayCountry.cities.map((relayCity) => this._renderCity(relayCountry.code, relayCity)) }
</Accordion>)
diff --git a/test/components/SelectLocation.spec.js b/test/components/SelectLocation.spec.js
index 459eb366ce..7ec17ff798 100644
--- a/test/components/SelectLocation.spec.js
+++ b/test/components/SelectLocation.spec.js
@@ -26,6 +26,11 @@ describe('components/SelectLocation', () => {
code: 'mma',
position: [0, 0],
hasActiveRelays: true,
+ }, {
+ name: 'Stockholm',
+ code: 'sto',
+ position: [0, 0],
+ hasActiveRelays: true,
}],
}],
allowLan: false,
@@ -86,7 +91,7 @@ describe('components/SelectLocation', () => {
}
});
const elements = ReactTestUtils.scryRenderedDOMComponentsWithClass(render(props), 'select-location__sub-cell');
- expect(elements).to.have.length(1);
+ expect(elements).to.have.length(2);
Simulate.click(elements[0]);
});