diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-17 06:50:26 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-18 20:28:12 +0800 |
commit | fb672e00df949da67266946d433c40cbbaf7d145 (patch) | |
tree | 9c050478dff5c87275ff311dc514e672d7502ee9 /ui/app/components/send/send-footer/tests/send-footer-utils.test.js | |
parent | 9ea7411c063712825780110c10252155ccb61e44 (diff) | |
download | tangerine-wallet-browser-fb672e00df949da67266946d433c40cbbaf7d145.tar.gz tangerine-wallet-browser-fb672e00df949da67266946d433c40cbbaf7d145.tar.zst tangerine-wallet-browser-fb672e00df949da67266946d433c40cbbaf7d145.zip |
Send data along with other tx params
Diffstat (limited to 'ui/app/components/send/send-footer/tests/send-footer-utils.test.js')
-rw-r--r-- | ui/app/components/send/send-footer/tests/send-footer-utils.test.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ui/app/components/send/send-footer/tests/send-footer-utils.test.js b/ui/app/components/send/send-footer/tests/send-footer-utils.test.js index 2d3135995..28ff0c891 100644 --- a/ui/app/components/send/send-footer/tests/send-footer-utils.test.js +++ b/ui/app/components/send/send-footer/tests/send-footer-utils.test.js @@ -65,6 +65,28 @@ describe('send-footer utils', () => { }) describe('constructTxParams()', () => { + it('should return a new txParams object with data if there data is given', () => { + assert.deepEqual( + constructTxParams({ + data: 'someData', + selectedToken: false, + to: 'mockTo', + amount: 'mockAmount', + from: 'mockFrom', + gas: 'mockGas', + gasPrice: 'mockGasPrice', + }), + { + data: '0xsomeData', + to: '0xmockTo', + value: '0xmockAmount', + from: '0xmockFrom', + gas: '0xmockGas', + gasPrice: '0xmockGasPrice', + } + ) + }) + it('should return a new txParams object with value and to properties if there is no selectedToken', () => { assert.deepEqual( constructTxParams({ @@ -76,6 +98,7 @@ describe('send-footer utils', () => { gasPrice: 'mockGasPrice', }), { + data: undefined, to: '0xmockTo', value: '0xmockAmount', from: '0xmockFrom', @@ -96,6 +119,7 @@ describe('send-footer utils', () => { gasPrice: 'mockGasPrice', }), { + data: undefined, value: '0x0', from: '0xmockFrom', gas: '0xmockGas', |