Validate sendToken address when component updates (#9907)

* Validate sendToken address when component updates

On a reproduction of trying to get the error message it seems that if an token address is provided in the address form with ETH selected then changing to a token address, the error message won't show.

This will validate the sendtoken address on prop change to properly update the warning message.

* Update test to include second doesAmountErrorRequireUpdate call when state is updated and component is updated
feature/default_network_editable
Thomas Huang 4 years ago committed by GitHub
parent 75de9086de
commit 44448465ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      ui/app/pages/send/send.component.js
  2. 2
      ui/app/pages/send/tests/send-component.test.js

@ -154,6 +154,7 @@ export default class SendTransactionScreen extends Component {
if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) {
this.updateSendToken()
this.validate(sendTokenAddress)
updateGas = true
}

@ -138,7 +138,7 @@ describe('Send Component', function () {
balance: '',
},
})
assert(utilsMethodStubs.doesAmountErrorRequireUpdate.calledOnce)
assert(utilsMethodStubs.doesAmountErrorRequireUpdate.calledTwice)
assert.deepEqual(
utilsMethodStubs.doesAmountErrorRequireUpdate.getCall(0).args[0],
{

Loading…
Cancel
Save