aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/tests/send-component.test.js
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-08-16 20:28:27 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commit0a7dfcd55d02a7204d8f0773ff9d91f325aabea8 (patch)
treea4c7d3e219ca926f17f26d020fddc78854a23b53 /ui/app/components/send/tests/send-component.test.js
parent112d18e316df312a648b8c8ac17c201314fc9ed6 (diff)
downloadtangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.gz
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.zst
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.zip
Connect the gas-button-group component to redux and a live api.
Diffstat (limited to 'ui/app/components/send/tests/send-component.test.js')
-rw-r--r--ui/app/components/send/tests/send-component.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/app/components/send/tests/send-component.test.js b/ui/app/components/send/tests/send-component.test.js
index bd136a0b8..0f3902c07 100644
--- a/ui/app/components/send/tests/send-component.test.js
+++ b/ui/app/components/send/tests/send-component.test.js
@@ -13,6 +13,7 @@ const propsMethodSpies = {
updateSendErrors: sinon.spy(),
updateSendTokenBalance: sinon.spy(),
resetSendState: sinon.spy(),
+ fetchGasEstimates: sinon.spy(),
}
const utilsMethodStubs = {
getAmountErrorObject: sinon.stub().returns({ amount: 'mockAmountError' }),
@@ -37,6 +38,7 @@ describe('Send Component', function () {
blockGasLimit={'mockBlockGasLimit'}
conversionRate={10}
editingTransactionId={'mockEditingTransactionId'}
+ fetchGasEstimates={propsMethodSpies.fetchGasEstimates}
from={ { address: 'mockAddress', balance: 'mockBalance' } }
gasLimit={'mockGasLimit'}
gasPrice={'mockGasPrice'}
@@ -63,6 +65,7 @@ describe('Send Component', function () {
utilsMethodStubs.doesAmountErrorRequireUpdate.resetHistory()
utilsMethodStubs.getAmountErrorObject.resetHistory()
utilsMethodStubs.getGasFeeErrorObject.resetHistory()
+ propsMethodSpies.fetchGasEstimates.resetHistory()
propsMethodSpies.updateAndSetGasTotal.resetHistory()
propsMethodSpies.updateSendErrors.resetHistory()
propsMethodSpies.updateSendTokenBalance.resetHistory()
@@ -82,6 +85,15 @@ describe('Send Component', function () {
})
})
+ describe('componentDidMount', () => {
+ it('should call props.fetchGasEstimates', () => {
+ propsMethodSpies.fetchGasEstimates.resetHistory()
+ assert.equal(propsMethodSpies.fetchGasEstimates.callCount, 0)
+ wrapper.instance().componentDidMount()
+ assert.equal(propsMethodSpies.fetchGasEstimates.callCount, 1)
+ })
+ })
+
describe('componentWillUnmount', () => {
it('should call this.props.resetSendState', () => {
propsMethodSpies.resetSendState.resetHistory()