diff options
author | Dan <danjm.com@gmail.com> | 2018-05-22 16:10:06 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-05-31 07:24:31 +0800 |
commit | 166fda58777748141859c0a674a5fce454cfc3d3 (patch) | |
tree | b8f743c927ff55ee02be61b013d3c726711381c3 /ui/app/components/send_/tests/send-container.test.js | |
parent | 17909465f283179aad39166b1191dbaba3770bf6 (diff) | |
download | tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.gz tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.tar.zst tangerine-wallet-browser-166fda58777748141859c0a674a5fce454cfc3d3.zip |
Simplify gas estimate actions and add local estimateGasPriceFromRecentBlocks method.
Diffstat (limited to 'ui/app/components/send_/tests/send-container.test.js')
-rw-r--r-- | ui/app/components/send_/tests/send-container.test.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/app/components/send_/tests/send-container.test.js b/ui/app/components/send_/tests/send-container.test.js index e589cca05..2129709c1 100644 --- a/ui/app/components/send_/tests/send-container.test.js +++ b/ui/app/components/send_/tests/send-container.test.js @@ -32,6 +32,7 @@ proxyquire('../send.container.js', { getGasPrice: (s) => `mockGasPrice:${s}`, getGasTotal: (s) => `mockGasTotal:${s}`, getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`, + getRecentBlocks: (s) => `mockRecentBlocks:${s}`, getSelectedAddress: (s) => `mockSelectedAddress:${s}`, getSelectedToken: (s) => `mockSelectedToken:${s}`, getSelectedTokenContract: (s) => `mockTokenContract:${s}`, @@ -66,6 +67,7 @@ describe('send container', () => { gasTotal: 'mockGasTotal:mockState', network: 'mockNetwork:mockState', primaryCurrency: 'mockPrimaryCurrency:mockState', + recentBlocks: 'mockRecentBlocks:mockState', selectedAddress: 'mockSelectedAddress:mockState', selectedToken: 'mockSelectedToken:mockState', tokenBalance: 'mockTokenBalance:mockState', @@ -91,6 +93,7 @@ describe('send container', () => { editingTransactionId: '0x2', gasLimit: '0x3', gasPrice: '0x4', + recentBlocks: ['mockBlock'], selectedAddress: '0x4', selectedToken: { address: '0x1' }, } @@ -105,14 +108,14 @@ describe('send container', () => { }) it('should dispatch an updateGasData action when editingTransactionId is falsy', () => { - const { selectedAddress, selectedToken, data } = mockProps + const { selectedAddress, selectedToken, data, recentBlocks } = mockProps mapDispatchToPropsObject.updateAndSetGasTotal( - Object.assign(mockProps, {editingTransactionId: false}) + Object.assign({}, mockProps, {editingTransactionId: false}) ) assert(dispatchSpy.calledOnce) assert.deepEqual( actionSpies.updateGasData.getCall(0).args[0], - { selectedAddress, selectedToken, data } + { selectedAddress, selectedToken, data, recentBlocks } ) }) }) |