diff options
author | Dan <danjm.com@gmail.com> | 2018-05-31 00:40:30 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-05-31 07:21:46 +0800 |
commit | 6d8344d0d0af3734255a0e9e79d857d84b5fe2aa (patch) | |
tree | a1f22d4291f2353dfe963cae0d32e9c60a3dbdb5 /ui/app/components/send_/tests | |
parent | 5347319dffa0a9e4df5fe26d5ea60293b3489f78 (diff) | |
download | tangerine-wallet-browser-6d8344d0d0af3734255a0e9e79d857d84b5fe2aa.tar.gz tangerine-wallet-browser-6d8344d0d0af3734255a0e9e79d857d84b5fe2aa.tar.zst tangerine-wallet-browser-6d8344d0d0af3734255a0e9e79d857d84b5fe2aa.zip |
Update amount error on update of send screen.
Diffstat (limited to 'ui/app/components/send_/tests')
-rw-r--r-- | ui/app/components/send_/tests/send-component.test.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/app/components/send_/tests/send-component.test.js b/ui/app/components/send_/tests/send-component.test.js index 8aeab36b4..4aa1978e4 100644 --- a/ui/app/components/send_/tests/send-component.test.js +++ b/ui/app/components/send_/tests/send-component.test.js @@ -25,7 +25,7 @@ const SendTransactionScreen = proxyquire('../send.component.js', { sinon.spy(SendTransactionScreen.prototype, 'componentDidMount') sinon.spy(SendTransactionScreen.prototype, 'updateGas') -describe('Send Component', function () { +describe.only('Send Component', function () { let wrapper beforeEach(() => { @@ -68,14 +68,17 @@ describe('Send Component', function () { describe('componentWillMount', () => { it('should call this.updateGas', () => { - assert(SendTransactionScreen.prototype.updateGas.calledOnce) + SendTransactionScreen.prototype.updateGas.resetHistory() + propsMethodSpies.updateSendErrors.resetHistory() + assert.equal(SendTransactionScreen.prototype.updateGas.callCount, 0) wrapper.instance().componentWillMount() - assert(SendTransactionScreen.prototype.updateGas.calledTwice) + assert.equal(SendTransactionScreen.prototype.updateGas.callCount, 1) }) }) describe('componentDidUpdate', () => { it('should call doesAmountErrorRequireUpdate with the expected params', () => { + utilsMethodStubs.getAmountErrorObject.resetHistory() wrapper.instance().componentDidUpdate({ from: { balance: '', @@ -97,6 +100,7 @@ describe('Send Component', function () { }) it('should not call getAmountErrorObject if doesAmountErrorRequireUpdate returns false', () => { + utilsMethodStubs.getAmountErrorObject.resetHistory() wrapper.instance().componentDidUpdate({ from: { balance: 'mockBalance', @@ -106,6 +110,7 @@ describe('Send Component', function () { }) it('should call getAmountErrorObject if doesAmountErrorRequireUpdate returns true', () => { + utilsMethodStubs.getAmountErrorObject.resetHistory() wrapper.instance().componentDidUpdate({ from: { balance: 'balanceChanged', @@ -128,6 +133,7 @@ describe('Send Component', function () { }) it('should call updateSendErrors with the expected params', () => { + propsMethodSpies.updateSendErrors.resetHistory() wrapper.instance().componentDidUpdate({ from: { balance: 'balanceChanged', |