Skip to content

Commit

Permalink
Merge branch 'develop' into test-e2e-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino authored Sep 11, 2019
2 parents 6241864 + 5a6290c commit 301794f
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ exports[`AccountApproval should render correctly 1`] = `
"textAlign": "center",
}
}
testID="dapp-name-title"
/>
<Text
numberOfLines={1}
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AccountApproval/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class AccountApproval extends PureComponent {
<View style={styles.header}>
<View style={styles.dapp}>
<WebsiteIcon style={styles.icon} title={title} url={url} />
<Text style={styles.headerTitle} numberOfLines={1}>
<Text style={styles.headerTitle} testID={'dapp-name-title'} numberOfLines={1}>
{title}
</Text>
<Text style={styles.headerUrl} numberOfLines={1}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exports[`BrowserBottomBar should render correctly 1`] = `
"width": 24,
}
}
testID="go-back-button"
>
<Icon
allowFontScaling={false}
Expand Down Expand Up @@ -61,6 +62,7 @@ exports[`BrowserBottomBar should render correctly 1`] = `
"width": 24,
}
}
testID="go-forward-button"
>
<Icon
allowFontScaling={false}
Expand Down Expand Up @@ -93,6 +95,7 @@ exports[`BrowserBottomBar should render correctly 1`] = `
"width": 24,
}
}
testID="search-button"
>
<Icon
allowFontScaling={false}
Expand Down Expand Up @@ -120,6 +123,7 @@ exports[`BrowserBottomBar should render correctly 1`] = `
"width": 24,
}
}
testID="show-tabs-button"
>
<Connect(TabCountIcon)
style={
Expand Down Expand Up @@ -169,6 +173,7 @@ exports[`BrowserBottomBar should render correctly 1`] = `
"width": 24,
}
}
testID="options-button"
>
<Icon
allowFontScaling={false}
Expand Down
20 changes: 15 additions & 5 deletions app/components/UI/BrowserBottomBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,38 @@ export default class BrowserBottomBar extends PureComponent {

return (
<ElevatedView elevation={11} style={styles.bottomBar}>
<TouchableOpacity onPress={goBack} style={styles.iconButton} disabled={!canGoBack}>
<TouchableOpacity
onPress={goBack}
style={styles.iconButton}
testID={'go-back-button'}
disabled={!canGoBack}
>
<Icon name="angle-left" size={24} style={[styles.icon, !canGoBack ? styles.disabledIcon : {}]} />
</TouchableOpacity>
<TouchableOpacity onPress={goForward} style={styles.iconButton} disabled={!canGoForward}>
<TouchableOpacity
onPress={goForward}
style={styles.iconButton}
testID={'go-forward-button'}
disabled={!canGoForward}
>
<Icon
name="angle-right"
size={24}
style={[styles.icon, !canGoForward ? styles.disabledIcon : {}]}
/>
</TouchableOpacity>
<TouchableOpacity onPress={showUrlModal} style={styles.iconButton}>
<TouchableOpacity onPress={showUrlModal} style={styles.iconButton} testID={'search-button'}>
<FeatherIcons name="search" size={24} style={styles.icon} />
</TouchableOpacity>

<TouchableOpacity onPress={showTabs} style={styles.iconButton}>
<TouchableOpacity onPress={showTabs} style={styles.iconButton} testID={'show-tabs-button'}>
<TabCountIcon style={styles.tabIcon} />
</TouchableOpacity>
<TouchableOpacity onPress={goHome} style={styles.iconButton}>
<SimpleLineIcons name="home" size={22} style={styles.icon} />
</TouchableOpacity>

<TouchableOpacity onPress={toggleOptions} style={styles.iconButton}>
<TouchableOpacity onPress={toggleOptions} style={styles.iconButton} testID={'options-button'}>
<MaterialIcon name="more-horiz" size={22} style={styles.icon} />
</TouchableOpacity>
</ElevatedView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`NetworkList should render correctly 1`] = `
"minHeight": 450,
}
}
testID="account-list"
testID="networks-list"
>
<View
style={
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/NetworkList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class NetworkList extends PureComponent {
}

render = () => (
<SafeAreaView style={styles.wrapper} testID={'account-list'}>
<SafeAreaView style={styles.wrapper} testID={'networks-list'}>
<View style={styles.titleWrapper}>
<Text testID={'networks-list-title'} style={styles.title} onPress={this.closeSideBar}>
{strings('networks.title')}
Expand Down
3 changes: 2 additions & 1 deletion app/components/UI/Tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class Tokens extends PureComponent {
return (
<AssetElement
key={itemAddress || '0x'}
testID={'asset'}
onPress={this.onItemPress}
onLongPress={asset.isETH ? null : this.showRemoveMenu}
asset={asset}
Expand All @@ -170,7 +171,7 @@ class Tokens extends PureComponent {
<TokenImage asset={asset} containerStyle={styles.ethLogo} />
)}

<View style={styles.balances}>
<View style={styles.balances} testID={'balance'}>
<Text style={styles.balance}>{mainBalance}</Text>
{secondaryBalance ? <Text style={styles.balanceFiat}>{secondaryBalance}</Text> : null}
</View>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionElement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class TransactionElement extends PureComponent {

renderTxTime = () => {
const { tx, selectedAddress } = this.props;
const incoming = toChecksumAddress(tx.transaction.to) === selectedAddress;
const incoming = tx.transaction.to && toChecksumAddress(tx.transaction.to) === selectedAddress;
const selfSent = incoming && toChecksumAddress(tx.transaction.from) === selectedAddress;
return (
<Text style={styles.date}>
Expand Down
6 changes: 5 additions & 1 deletion app/components/UI/TransactionNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export const TransactionNotification = props => {
<Fragment>
<View style={styles.flashIcon}>{this._getIcon()}</View>
<View style={styles.flashLabel}>
<Text style={styles.flashTitle}>{this._getTitle()}</Text>
<Text style={styles.flashTitle} testID={'notification-title'}>
{this._getTitle()}
</Text>
<Text style={styles.flashText}>{this._getDescription()}</Text>
</View>
</Fragment>
Expand All @@ -138,6 +140,7 @@ export const TransactionNotification = props => {
<ElevatedView elevation={10} style={baseStyles.flex}>
<GestureRecognizer
// eslint-disable-next-line react/jsx-no-bind
testID={'notification-swipe'}
onSwipeDown={() => hideMessage()}
config={{
velocityThreshold: 0.2,
Expand All @@ -147,6 +150,7 @@ export const TransactionNotification = props => {
>
<TouchableOpacity
style={[styles.defaultFlash, styles.defaultFlashFloating]}
testID={'press-notification-button'}
onPress={this._onPress}
activeOpacity={0.8}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Transactions should render correctly 1`] = `
"flex": 1,
}
}
testID="transactions"
testID="transactions-screen"
>
<View
style={
Expand Down
3 changes: 2 additions & 1 deletion app/components/UI/Transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class Transactions extends PureComponent {
<TransactionElement
tx={item}
i={index}
testID={'txn-item'}
selectedAddress={this.props.selectedAddress}
selected={!!this.state.selectedTx.get(item.id)}
onPressItem={this.toggleDetailsView}
Expand Down Expand Up @@ -264,7 +265,7 @@ class Transactions extends PureComponent {
}

render = () => (
<View testID={'transactions'} style={styles.wrapper}>
<View style={styles.wrapper} testID={'transactions-screen'}>
{this.renderContent()}
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`Approval should render correctly 1`] = `
"flex": 1,
}
}
testID="confirm-transaction-screen"
>
<Connect(TransactionEditor)
mode="review"
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Approval/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Approval extends PureComponent {
const { transaction } = this.props;
const { mode } = this.state;
return (
<SafeAreaView style={styles.wrapper}>
<SafeAreaView style={styles.wrapper} testID={'confirm-transaction-screen'}>
<TransactionEditor
mode={mode}
onCancel={this.onCancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ exports[`Browser should render correctly 1`] = `
"paddingTop": 50,
}
}
testID="url-modal"
>
<TextInput
allowFontScaling={true}
Expand Down Expand Up @@ -111,6 +112,7 @@ exports[`Browser should render correctly 1`] = `
"textAlign": "left",
}
}
testID="url-input"
underlineColorAndroid="transparent"
value=""
/>
Expand All @@ -123,6 +125,7 @@ exports[`Browser should render correctly 1`] = `
"marginTop": 7,
}
}
testID="cancel-url-button"
>
<Text
style={
Expand Down
10 changes: 7 additions & 3 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1485,12 +1485,13 @@ export class BrowserTab extends PureComponent {
animationOutTiming={300}
useNativeDriver
>
<View style={styles.urlModalContent}>
<View style={styles.urlModalContent} testID={'url-modal'}>
<TextInput
ref={this.inputRef}
autoCapitalize="none"
autoCorrect={false}
clearButtonMode="while-editing"
testID={'url-input'}
onChangeText={this.onURLChange}
onSubmitEditing={this.onUrlInputSubmit}
placeholder={strings('autocomplete.placeholder')}
Expand All @@ -1506,7 +1507,11 @@ export class BrowserTab extends PureComponent {
<MaterialIcon name="close" size={20} style={[styles.icon, styles.iconClose]} />
</TouchableOpacity>
) : (
<TouchableOpacity style={styles.cancelButton} onPress={this.hideUrlModal}>
<TouchableOpacity
style={styles.cancelButton}
testID={'cancel-url-button'}
onPress={this.hideUrlModal}
>
<Text style={styles.cancelButtonText}>{strings('browser.cancel')}</Text>
</TouchableOpacity>
)}
Expand Down Expand Up @@ -1722,7 +1727,6 @@ export class BrowserTab extends PureComponent {
userAgent={USER_AGENT}
sendCookies
javascriptEnabled
testID={'browser-webview'}
/>
)}
</View>
Expand Down
Loading

0 comments on commit 301794f

Please sign in to comment.