Skip to content

Commit

Permalink
fix(automation): add swap data-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Jan 21, 2021
1 parent 77a6992 commit 3d3e9ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const CryptoAccountOption: React.FC<Props> = props => {
style={{ marginRight: '12px' }}
/>
<div>
<OptionTitle>{account.label}</OptionTitle>
<OptionTitle data-e2e={account.label}>{account.label}</OptionTitle>
<OptionValue>
<BalanceRow>
<CoinBalance account={account} walletCurrency={walletCurrency} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class InitSwapForm extends PureComponent<InjectedFormProps<{}, Props> & Props> {
defaultMessage='Swap from'
/>
</Text>
<OptionTitle>{values.BASE.label}</OptionTitle>
<OptionTitle data-e2e='swapFromWallet'>
{values.BASE.label}
</OptionTitle>
<OptionValue>
<BalanceRow>
<CoinBalance
Expand Down Expand Up @@ -180,7 +182,7 @@ class InitSwapForm extends PureComponent<InjectedFormProps<{}, Props> & Props> {
defaultMessage='Receive to'
/>
</OptionValue>
<OptionTitle color='grey900'>
<OptionTitle data-e2e='swapToWallet' color='grey900'>
{values.COUNTER.label}
</OptionTitle>
<OptionValue>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
<Title>
<FormattedMessage id='copy.swap' defaultMessage='Swap' />
</Title>
<Value>
<Value data-e2e='swapOutgoingValue'>
{coinToString({
value: this.props.swapAmountFormValues?.cryptoAmount,
unit: { symbol: baseCoinTicker }
Expand All @@ -96,7 +96,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
<Title>
<FormattedMessage id='buttons.receive' defaultMessage='Receive' />
</Title>
<Value>
<Value data-e2e='swapIncomingValue'>
{this.props.incomingAmountR.cata({
Success: value => (
<>
Expand All @@ -119,7 +119,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
defaultMessage='Exchange Rate'
/>
</Title>
<Value>
<Value data-e2e='swapExchangeRate'>
{this.props.quoteR.cata({
Success: val => (
<>
Expand All @@ -144,13 +144,13 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
<Title>
<FormattedMessage id='copy.from' defaultMessage='From' />
</Title>
<Value>{BASE.label}</Value>
<Value data-e2e='swapOutgoingWallet'>{BASE.label}</Value>
</Row>
<Row>
<Title>
<FormattedMessage id='copy.to' defaultMessage='To' />
</Title>
<Value>{COUNTER.label}</Value>
<Value data-e2e='swapIncomingWallet'>{COUNTER.label}</Value>
</Row>
<Row>
<Title>
Expand All @@ -160,7 +160,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
values={{ coin: coins[BASE.coin].coinTicker }}
/>
</Title>
<Value>
<Value data-e2e='swapOutgoingFee'>
{BASE.type === 'CUSTODIAL' ? (
<FreeCartridge>
<FormattedMessage id='copy.free' defaultMessage='FREE' />
Expand Down Expand Up @@ -193,7 +193,7 @@ class PreviewSwap extends PureComponent<InjectedFormProps<{}, Props> & Props> {
values={{ coin: counterCoinTicker }}
/>
</Title>
<Value>
<Value data-e2e='swapIncomingFee'>
{COUNTER.type === 'CUSTODIAL' ? (
<FreeCartridge>
<FormattedMessage id='copy.free' defaultMessage='FREE' />
Expand Down

0 comments on commit 3d3e9ad

Please sign in to comment.