Fix display of primary currency symbol in send amount row

feature/default_network_editable
Dan 7 years ago
parent c4e48d9263
commit 1405237479
  1. 4
      ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
  2. 6
      ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js

@ -64,7 +64,7 @@ export default class SendAmountRow extends Component {
convertedCurrency,
gasTotal,
inError,
primaryCurrency = 'ETH',
primaryCurrency,
selectedToken,
} = this.props
@ -80,7 +80,7 @@ export default class SendAmountRow extends Component {
convertedCurrency={convertedCurrency}
handleChange={newAmount => this.handleAmountChange(newAmount)}
inError={inError}
primaryCurrency={primaryCurrency}
primaryCurrency={primaryCurrency || 'ETH'}
selectedToken={selectedToken}
value={amount || '0x0'}
/>

@ -156,5 +156,11 @@ describe('SendAmountRow Component', function () {
['mockNewAmount']
)
})
it('should pass the default primaryCurrency to the CurrencyDisplay if primaryCurrency is falsy', () => {
wrapper.setProps({ primaryCurrency: null })
const { primaryCurrency } = wrapper.find(SendRowWrapper).childAt(1).props()
assert.equal(primaryCurrency, 'ETH')
})
})
})

Loading…
Cancel
Save