diff options
author | Esteban MIno <efmino@uc.cl> | 2018-08-04 02:56:02 +0800 |
---|---|---|
committer | Esteban MIno <efmino@uc.cl> | 2018-08-04 02:56:02 +0800 |
commit | 21a61f2987ae83a48bb1f7256ec9c34978413eb2 (patch) | |
tree | 3bc9ef3d342f17269942cd3fe58da1f3b97ef214 /ui/app/components/send_/send-content/send-gas-row/tests | |
parent | 0481335dda447ba4c228d146834952bac0ad641b (diff) | |
parent | fa4423bab2886017996955f809b6e3102cbf1781 (diff) | |
download | tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.gz tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.zst tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.zip |
merge develop
Diffstat (limited to 'ui/app/components/send_/send-content/send-gas-row/tests')
3 files changed, 0 insertions, 153 deletions
diff --git a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-component.test.js deleted file mode 100644 index e4f05d708..000000000 --- a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-component.test.js +++ /dev/null @@ -1,65 +0,0 @@ -import React from 'react' -import assert from 'assert' -import { shallow } from 'enzyme' -import sinon from 'sinon' -import SendGasRow from '../send-gas-row.component.js' - -import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component' -import GasFeeDisplay from '../../../../send/gas-fee-display-v2' - -const propsMethodSpies = { - showCustomizeGasModal: sinon.spy(), -} - -describe('SendGasRow Component', function () { - let wrapper - - beforeEach(() => { - wrapper = shallow(<SendGasRow - conversionRate={20} - convertedCurrency={'mockConvertedCurrency'} - gasLoadingError={false} - gasTotal={'mockGasTotal'} - showCustomizeGasModal={propsMethodSpies.showCustomizeGasModal} - />, { context: { t: str => str + '_t' } }) - }) - - afterEach(() => { - propsMethodSpies.showCustomizeGasModal.resetHistory() - }) - - describe('render', () => { - it('should render a SendRowWrapper component', () => { - assert.equal(wrapper.find(SendRowWrapper).length, 1) - }) - - it('should pass the correct props to SendRowWrapper', () => { - const { - label, - } = wrapper.find(SendRowWrapper).props() - - assert.equal(label, 'gasFee_t:') - }) - - it('should render a GasFeeDisplay as a child of the SendRowWrapper', () => { - assert(wrapper.find(SendRowWrapper).childAt(0).is(GasFeeDisplay)) - }) - - it('should render the GasFeeDisplay with the correct props', () => { - const { - conversionRate, - convertedCurrency, - gasLoadingError, - gasTotal, - onClick, - } = wrapper.find(SendRowWrapper).childAt(0).props() - assert.equal(conversionRate, 20) - assert.equal(convertedCurrency, 'mockConvertedCurrency') - assert.equal(gasLoadingError, false) - assert.equal(gasTotal, 'mockGasTotal') - assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 0) - onClick() - assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 1) - }) - }) -}) diff --git a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-container.test.js b/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-container.test.js deleted file mode 100644 index 9135524d1..000000000 --- a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-container.test.js +++ /dev/null @@ -1,66 +0,0 @@ -import assert from 'assert' -import proxyquire from 'proxyquire' -import sinon from 'sinon' - -let mapStateToProps -let mapDispatchToProps - -const actionSpies = { - showModal: sinon.spy(), -} - -proxyquire('../send-gas-row.container.js', { - 'react-redux': { - connect: (ms, md) => { - mapStateToProps = ms - mapDispatchToProps = md - return () => ({}) - }, - }, - '../../send.selectors.js': { - getConversionRate: (s) => `mockConversionRate:${s}`, - getConvertedCurrency: (s) => `mockConvertedCurrency:${s}`, - getGasTotal: (s) => `mockGasTotal:${s}`, - }, - './send-gas-row.selectors.js': { sendGasIsInError: (s) => `mockGasLoadingError:${s}` }, - '../../../../actions': actionSpies, -}) - -describe('send-gas-row container', () => { - - describe('mapStateToProps()', () => { - - it('should map the correct properties to props', () => { - assert.deepEqual(mapStateToProps('mockState'), { - conversionRate: 'mockConversionRate:mockState', - convertedCurrency: 'mockConvertedCurrency:mockState', - gasTotal: 'mockGasTotal:mockState', - gasLoadingError: 'mockGasLoadingError:mockState', - }) - }) - - }) - - describe('mapDispatchToProps()', () => { - let dispatchSpy - let mapDispatchToPropsObject - - beforeEach(() => { - dispatchSpy = sinon.spy() - mapDispatchToPropsObject = mapDispatchToProps(dispatchSpy) - }) - - describe('showCustomizeGasModal()', () => { - it('should dispatch an action', () => { - mapDispatchToPropsObject.showCustomizeGasModal() - assert(dispatchSpy.calledOnce) - assert.deepEqual( - actionSpies.showModal.getCall(0).args[0], - { name: 'CUSTOMIZE_GAS' } - ) - }) - }) - - }) - -}) diff --git a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-selectors.test.js b/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-selectors.test.js deleted file mode 100644 index a5196334e..000000000 --- a/ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-selectors.test.js +++ /dev/null @@ -1,22 +0,0 @@ -import assert from 'assert' -import { - sendGasIsInError, -} from '../send-gas-row.selectors.js' - -describe('send-gas-row selectors', () => { - - describe('sendGasIsInError()', () => { - it('should return send.errors.gasLoading', () => { - const state = { - send: { - errors: { - gasLoading: 'abc', - }, - }, - } - - assert.equal(sendGasIsInError(state), 'abc') - }) - }) - -}) |