summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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]);
});