aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/tests/send-component.test.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-06-19 02:54:26 +0800
committerGitHub <noreply@github.com>2018-06-19 02:54:26 +0800
commit62df4463859bc6836608ecb0478da67456f15e73 (patch)
treeff2aa786ff4b9afa96bea11d0d90382d75312821 /ui/app/components/send_/tests/send-component.test.js
parent9a7f363c2a8dcec041569c59e1b1a7c485515a33 (diff)
parent0c8318b02a5ccb11f5de43a8c9894873e29c2401 (diff)
downloadtangerine-wallet-browser-62df4463859bc6836608ecb0478da67456f15e73.tar.gz
tangerine-wallet-browser-62df4463859bc6836608ecb0478da67456f15e73.tar.zst
tangerine-wallet-browser-62df4463859bc6836608ecb0478da67456f15e73.zip
Merge pull request #4584 from MetaMask/fix-send-token
Add hex-prefix to gas estimate result
Diffstat (limited to 'ui/app/components/send_/tests/send-component.test.js')
-rw-r--r--ui/app/components/send_/tests/send-component.test.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/app/components/send_/tests/send-component.test.js b/ui/app/components/send_/tests/send-component.test.js
index 4e33d8f63..4ba9b226d 100644
--- a/ui/app/components/send_/tests/send-component.test.js
+++ b/ui/app/components/send_/tests/send-component.test.js
@@ -201,7 +201,7 @@ describe('Send Component', function () {
})
describe('updateGas', () => {
- it('should call updateAndSetGasTotal with the correct params', () => {
+ it('should call updateAndSetGasTotal with the correct params if no to prop is passed', () => {
propsMethodSpies.updateAndSetGasTotal.resetHistory()
wrapper.instance().updateGas()
assert.equal(propsMethodSpies.updateAndSetGasTotal.callCount, 1)
@@ -215,12 +215,22 @@ describe('Send Component', function () {
recentBlocks: ['mockBlock'],
selectedAddress: 'mockSelectedAddress',
selectedToken: 'mockSelectedToken',
- to: undefined,
+ to: '',
value: 'mockAmount',
}
)
})
+ it('should call updateAndSetGasTotal with the correct params if a to prop is passed', () => {
+ propsMethodSpies.updateAndSetGasTotal.resetHistory()
+ wrapper.setProps({ to: 'someAddress' })
+ wrapper.instance().updateGas()
+ assert.equal(
+ propsMethodSpies.updateAndSetGasTotal.getCall(0).args[0].to,
+ 'someaddress',
+ )
+ })
+
it('should call updateAndSetGasTotal with to set to lowercase if passed', () => {
propsMethodSpies.updateAndSetGasTotal.resetHistory()
wrapper.instance().updateGas({ to: '0xABC' })