aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-20 23:48:23 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-07-16 23:28:32 +0800
commitb3d78ed8a1fbea059344b04416fb21bdb1b73f86 (patch)
tree6a2d8f6dda690961331c9bcbf5e2c6bf7102bced /ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js
parentf31e87dcd5cec09e81c741e311efc3793c9d9b98 (diff)
downloadtangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.gz
tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.zst
tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.zip
Remove send_ directory, revert to just having send
Revert accidentally changed constants. Require defaults in ens-input, gas-fee-display and confirm screens.
Diffstat (limited to 'ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js')
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js125
1 files changed, 0 insertions, 125 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js
deleted file mode 100644
index 52e351aee..000000000
--- a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-container.test.js
+++ /dev/null
@@ -1,125 +0,0 @@
-import assert from 'assert'
-import proxyquire from 'proxyquire'
-import sinon from 'sinon'
-
-let mapStateToProps
-let mapDispatchToProps
-
-const actionSpies = {
- setMaxModeTo: sinon.spy(),
- updateSendAmount: sinon.spy(),
-}
-const duckActionSpies = {
- updateSendErrors: sinon.spy(),
-}
-
-proxyquire('../send-amount-row.container.js', {
- 'react-redux': {
- connect: (ms, md) => {
- mapStateToProps = ms
- mapDispatchToProps = md
- return () => ({})
- },
- },
- '../../send.selectors': {
- getAmountConversionRate: (s) => `mockAmountConversionRate:${s}`,
- getConversionRate: (s) => `mockConversionRate:${s}`,
- getCurrentCurrency: (s) => `mockConvertedCurrency:${s}`,
- getGasTotal: (s) => `mockGasTotal:${s}`,
- getPrimaryCurrency: (s) => `mockPrimaryCurrency:${s}`,
- getSelectedToken: (s) => `mockSelectedToken:${s}`,
- getSendAmount: (s) => `mockAmount:${s}`,
- getSendFromBalance: (s) => `mockBalance:${s}`,
- getTokenBalance: (s) => `mockTokenBalance:${s}`,
- },
- './send-amount-row.selectors': { sendAmountIsInError: (s) => `mockInError:${s}` },
- '../../send.utils': {
- getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }),
- getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }),
- },
- '../../../../actions': actionSpies,
- '../../../../ducks/send.duck': duckActionSpies,
-})
-
-describe('send-amount-row container', () => {
-
- describe('mapStateToProps()', () => {
-
- it('should map the correct properties to props', () => {
- assert.deepEqual(mapStateToProps('mockState'), {
- amount: 'mockAmount:mockState',
- amountConversionRate: 'mockAmountConversionRate:mockState',
- balance: 'mockBalance:mockState',
- conversionRate: 'mockConversionRate:mockState',
- convertedCurrency: 'mockConvertedCurrency:mockState',
- gasTotal: 'mockGasTotal:mockState',
- inError: 'mockInError:mockState',
- primaryCurrency: 'mockPrimaryCurrency:mockState',
- selectedToken: 'mockSelectedToken:mockState',
- tokenBalance: 'mockTokenBalance:mockState',
- })
- })
-
- })
-
- describe('mapDispatchToProps()', () => {
- let dispatchSpy
- let mapDispatchToPropsObject
-
- beforeEach(() => {
- dispatchSpy = sinon.spy()
- mapDispatchToPropsObject = mapDispatchToProps(dispatchSpy)
- duckActionSpies.updateSendErrors.resetHistory()
- })
-
- describe('setMaxModeTo()', () => {
- it('should dispatch an action', () => {
- mapDispatchToPropsObject.setMaxModeTo('mockBool')
- assert(dispatchSpy.calledOnce)
- assert(actionSpies.setMaxModeTo.calledOnce)
- assert.equal(
- actionSpies.setMaxModeTo.getCall(0).args[0],
- 'mockBool'
- )
- })
- })
-
- describe('updateSendAmount()', () => {
- it('should dispatch an action', () => {
- mapDispatchToPropsObject.updateSendAmount('mockAmount')
- assert(dispatchSpy.calledOnce)
- assert(actionSpies.updateSendAmount.calledOnce)
- assert.equal(
- actionSpies.updateSendAmount.getCall(0).args[0],
- 'mockAmount'
- )
- })
- })
-
- describe('updateGasFeeError()', () => {
- it('should dispatch an action', () => {
- mapDispatchToPropsObject.updateGasFeeError({ some: 'data' })
- assert(dispatchSpy.calledOnce)
- assert(duckActionSpies.updateSendErrors.calledOnce)
- assert.deepEqual(
- duckActionSpies.updateSendErrors.getCall(0).args[0],
- { some: 'data', mockGasFeeErrorChange: true }
- )
- })
- })
-
- describe('updateSendAmountError()', () => {
- it('should dispatch an action', () => {
- mapDispatchToPropsObject.updateSendAmountError({ some: 'data' })
- assert(dispatchSpy.calledOnce)
- assert(duckActionSpies.updateSendErrors.calledOnce)
- assert.deepEqual(
- duckActionSpies.updateSendErrors.getCall(0).args[0],
- { some: 'data', mockChange: true }
- )
- })
- })
-
- })
-
-})