diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-06-16 06:31:16 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-06-16 06:31:16 +0800 |
commit | adb71073c8c3d2e3f76dd7591e87d4b64074c24e (patch) | |
tree | 4d608520099038a37f5b1272462b8f06e349e931 /ui | |
parent | 5685c4bafed0458e350b401791e108b8162a88e0 (diff) | |
download | tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar.gz tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar.bz2 tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar.lz tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar.xz tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.tar.zst tangerine-wallet-browser-adb71073c8c3d2e3f76dd7591e87d4b64074c24e.zip |
Fix unit tests
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js index 2205579ca..6e6c80890 100644 --- a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js +++ b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js @@ -12,10 +12,12 @@ const propsMethodSpies = { setMaxModeTo: sinon.spy(), updateSendAmount: sinon.spy(), updateSendAmountError: sinon.spy(), + updateGas: sinon.spy(), } sinon.spy(SendAmountRow.prototype, 'updateAmount') sinon.spy(SendAmountRow.prototype, 'validateAmount') +sinon.spy(SendAmountRow.prototype, 'updateGas') describe('SendAmountRow Component', function () { let wrapper @@ -36,6 +38,7 @@ describe('SendAmountRow Component', function () { tokenBalance={'mockTokenBalance'} updateSendAmount={propsMethodSpies.updateSendAmount} updateSendAmountError={propsMethodSpies.updateSendAmountError} + updateGas={propsMethodSpies.updateGas} />, { context: { t: str => str + '_t' } }) instance = wrapper.instance() }) @@ -139,15 +142,17 @@ describe('SendAmountRow Component', function () { assert.equal(primaryCurrency, 'mockPrimaryCurrency') assert.deepEqual(selectedToken, { address: 'mockTokenAddress' }) assert.equal(value, 'mockAmount') - assert.equal(SendAmountRow.prototype.updateAmount.callCount, 0) + assert.equal(SendAmountRow.prototype.updateGas.callCount, 0) onBlur('mockNewAmount') - assert.equal(SendAmountRow.prototype.updateAmount.callCount, 1) + assert.equal(SendAmountRow.prototype.updateGas.callCount, 1) assert.deepEqual( - SendAmountRow.prototype.updateAmount.getCall(0).args, + SendAmountRow.prototype.updateGas.getCall(0).args, ['mockNewAmount'] ) + assert.equal(SendAmountRow.prototype.updateAmount.callCount, 0) assert.equal(SendAmountRow.prototype.validateAmount.callCount, 0) onChange('mockNewAmount') + assert.equal(SendAmountRow.prototype.updateAmount.callCount, 1) assert.equal(SendAmountRow.prototype.validateAmount.callCount, 1) assert.deepEqual( SendAmountRow.prototype.validateAmount.getCall(0).args, |