diff options
| author | anderklander <anderklander@gmail.com> | 2017-12-14 13:55:39 +0100 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-12-22 13:54:53 +0100 |
| commit | 4b493786ab8b45ced29671f59ae7c89887e6ef4c (patch) | |
| tree | ae9abaf7eccf69fa426e6605a60ac87ba100cb7b | |
| parent | d3d1df97a9de4e9d3938eacc9ccdc0fc9fad9238 (diff) | |
| download | mullvadvpn-4b493786ab8b45ced29671f59ae7c89887e6ef4c.tar.xz mullvadvpn-4b493786ab8b45ced29671f59ae7c89887e6ef4c.zip | |
Lint-stuff
| -rw-r--r-- | app/components/Settings.js | 40 | ||||
| -rw-r--r-- | test/components/Settings.spec.js | 4 |
2 files changed, 19 insertions, 25 deletions
diff --git a/app/components/Settings.js b/app/components/Settings.js index bf675ef2db..6e48bf613a 100644 --- a/app/components/Settings.js +++ b/app/components/Settings.js @@ -1,10 +1,10 @@ // @flow import moment from 'moment'; import React from 'react'; -import { Component, Text, Image, Button, View } from "reactxp"; +import { Component, Text, Button, View } from 'reactxp'; import { Layout, Container, Header } from './Layout'; import CustomScrollbars from './CustomScrollbars'; -import styles from "./SettingsStyles"; +import styles from './SettingsStyles'; import Img from './Img'; import type { AccountReduxState } from '../redux/account/reducers'; @@ -41,8 +41,8 @@ export default class Settings extends Component { <Header hidden={ true } style={ 'defaultDark' } /> <Container> <View style={styles.settings}> - <Button style={styles.settings__close} onPress={ this.props.onClose } testName="settings__close"> - <Img style={styles.settings__close_icon} source="icon-close" tintColor="currentColor"/> + <Button style={styles.settings__close} onPress={ this.props.onClose } testName='settings__close'> + <Img style={styles.settings__close_icon} source='icon-close' tintColor='currentColor'/> </Button> <View style={styles.settings__container}> @@ -56,18 +56,18 @@ export default class Settings extends Component { <View style={styles.settings__main}> {/* show account options when logged in */} {isLoggedIn ? ( - <View style={styles.settings_account} testName="settings__account"> - <Button onPress={ this.props.onViewAccount } testName="settings__view_account"> + <View style={styles.settings_account} testName='settings__account'> + <Button onPress={ this.props.onViewAccount } testName='settings__view_account'> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>Account</Text> <View style={styles.settings__cell_value}> {isOutOfTime ? ( - <Text style={styles.settings__account_paid_until_label__error} testName="settings__account_paid_until_label">OUT OF TIME</Text> + <Text style={styles.settings__account_paid_until_label__error} testName='settings__account_paid_until_label'>OUT OF TIME</Text> ) : ( - <Text style={styles.settings__account_paid_until_label} testName="settings__account_paid_until_label">{formattedExpiry}</Text> + <Text style={styles.settings__account_paid_until_label} testName='settings__account_paid_until_label'>{formattedExpiry}</Text> )} </View> - <Img style={styles.settings__cell_disclosure} source="icon-chevron"/> + <Img style={styles.settings__cell_disclosure} source='icon-chevron'/> </View> </Button> <View style={styles.settings__cell_spacer} /> @@ -78,7 +78,7 @@ export default class Settings extends Component { <Button onPress={ this.props.onViewAdvancedSettings }> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>Advanced</Text> - <Img style={styles.settings__cell_disclosure} source="icon-chevron" tintColor="currentColor" /> + <Img style={styles.settings__cell_disclosure} source='icon-chevron' tintColor='currentColor' /> </View> <View style={styles.settings__cell_spacer}></View> </Button> @@ -88,39 +88,37 @@ export default class Settings extends Component { <Button onPress={ this.props.onViewAdvancedSettings }> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>Advanced</Text> - <Img style={styles.settings__cell_disclosure} source="icon-chevron" tintColor="currentColor"/> + <Img style={styles.settings__cell_disclosure} source='icon-chevron' tintColor='currentColor'/> </View> <View style={styles.settings__cell_spacer}></View> </Button> ) : null} - <Button onPress={ this.props.onExternalLink.bind(this, "faq") } testName="settings__external_link"> + <Button onPress={ this.props.onExternalLink.bind(this, 'faq') } testName='settings__external_link'> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>FAQs</Text> - <Img style={styles.settings__cell_icon} source="icon-extLink" tintColor="currentColor"/> + <Img style={styles.settings__cell_icon} source='icon-extLink' tintColor='currentColor'/> </View> </Button> - <Button onPress={ this.props.onExternalLink.bind(this, "guides") } testName="settings__external_link"> + <Button onPress={ this.props.onExternalLink.bind(this, 'guides') } testName='settings__external_link'> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>Guides</Text> - <Img style={styles.settings__cell_icon} source="icon-extLink" tintColor="currentColor"/> + <Img style={styles.settings__cell_icon} source='icon-extLink' tintColor='currentColor'/> </View> </Button> - <Button onPress={ this.props.onViewSupport } testName="settings__view_support"> + <Button onPress={ this.props.onViewSupport } testName='settings__view_support'> <View style={styles.settings__cell}> <Text style={styles.settings__cell_label}>Contact support</Text> - <Img style={styles.settings__cell_icon} source="icon-chevron" tintColor="currentColor"/> + <Img style={styles.settings__cell_icon} source='icon-chevron' tintColor='currentColor'/> </View> </Button> - - </View> </View> <View style={styles.settings__footer}> - <Button style={styles.settings__footer_button} onPress={this.props.onQuit} testName="settings__quit"> - <Text style={styles.settings__footer_button_label}>Quit app</Text> + <Button style={styles.settings__footer_button} onPress={this.props.onQuit} testName='settings__quit'> + <Text style={styles.settings__footer_button_label}>Quit app</Text> </Button> </View> </View> diff --git a/test/components/Settings.spec.js b/test/components/Settings.spec.js index 2baede24a2..bef928fcee 100644 --- a/test/components/Settings.spec.js +++ b/test/components/Settings.spec.js @@ -168,10 +168,6 @@ function getComponent(container, testName) { return container.findWhere( n => n.prop('testName') === testName); } -function hasChild(container, testName) { - return getComponent(container, testName).length > 0; -} - function click(component) { component.prop('onPress')(); } |
