From 6d8344d0d0af3734255a0e9e79d857d84b5fe2aa Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 30 May 2018 14:10:30 -0230 Subject: Update amount error on update of send screen. --- ui/app/components/send_/tests/send-component.test.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ui/app/components/send_/tests/send-component.test.js') 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', -- cgit v1.2.3