summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-10-14 16:09:57 +0200
committerAndrej Mihajlov <and@mullvad.net>2017-10-19 14:16:38 +0200
commit688796d784bfcc8a5a6deb4b4d749aafa728499c (patch)
tree7f652644862cf0134c7bee09d24d6be36be0a2ff
parentabb86c88dc23096714c58785cc2393585d54ea27 (diff)
downloadmullvadvpn-688796d784bfcc8a5a6deb4b4d749aafa728499c.tar.xz
mullvadvpn-688796d784bfcc8a5a6deb4b4d749aafa728499c.zip
Add test for support item in settings
-rw-r--r--app/components/Settings.js2
-rw-r--r--test/components/Settings.spec.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/components/Settings.js b/app/components/Settings.js
index 97db5c9844..4c906a9dc1 100644
--- a/app/components/Settings.js
+++ b/app/components/Settings.js
@@ -82,7 +82,7 @@ export default class Settings extends Component {
<div className="settings__cell-label">Guides</div>
<img className="settings__cell-icon" src="./assets/images/icon-extLink.svg" />
</div>
- <div className="settings__cell settings__cell--active" onClick={ this.props.onViewSupport }>
+ <div className="settings__view-support settings__cell settings__cell--active" onClick={ this.props.onViewSupport }>
<div className="settings__cell-label">Contact support</div>
<img className="settings__cell-disclosure" src="assets/images/icon-chevron.svg" />
</div>
diff --git a/test/components/Settings.spec.js b/test/components/Settings.spec.js
index 96b2178fe0..f90d658f9b 100644
--- a/test/components/Settings.spec.js
+++ b/test/components/Settings.spec.js
@@ -128,6 +128,14 @@ describe('components/Settings', () => {
Simulate.click(domNode);
});
+ it('should call support callback', (done) => {
+ const props = makeProps(loggedInAccountState, settingsState, {
+ onViewSupport: () => done()
+ });
+ const domNode = ReactTestUtils.findRenderedDOMComponentWithClass(render(props), 'settings__view-support');
+ Simulate.click(domNode);
+ });
+
it('should call external links callback', () => {
let collectedExternalLinkTypes: Array<string> = [];
const props = makeProps(loggedOutAccountState, settingsState, {