From 31175625b446cb5d18b17db23018bca8b14d280c Mon Sep 17 00:00:00 2001
From: Chi Kei Chan <chikeichan@gmail.com>
Date: Thu, 21 Mar 2019 16:03:30 -0700
Subject: Folder restructure (#6304)

* Remove ui/app/keychains/

* Remove ui/app/img/ (unused images)

* Move conversion-util to helpers/utils/

* Move token-util to helpers/utils/

* Move /helpers/*.js inside /helpers/utils/

* Move util tests inside /helpers/utils/

* Renameand move confirm-transaction/util.js to helpers/utils/

* Move higher-order-components to helpers/higher-order-components/

* Move infura-conversion.json to helpers/constants/

* Move all utility functions to helpers/utils/

* Move pages directory to top-level

* Move all constants to helpers/constants/

* Move metametrics inside helpers/

* Move app and root inside pages/

* Move routes inside helpers/

* Re-organize ducks/

* Move reducers to ducks/

* Move selectors inside selectors/

* Move test out of test folder

* Move action, reducer, store inside store/

* Move ui components inside ui/

* Move UI components inside ui/

* Move connected components inside components/app/

* Move i18n-helper inside helpers/

* Fix unit tests

* Fix unit test

* Move pages components

* Rename routes component

* Move reducers to ducks/index

* Fix bad path in unit test
---
 .../tests/send-to-row-component.test.js            | 166 ---------------------
 1 file changed, 166 deletions(-)
 delete mode 100644 ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js

(limited to 'ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js')

diff --git a/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js b/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js
deleted file mode 100644
index d4d054057..000000000
--- a/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js
+++ /dev/null
@@ -1,166 +0,0 @@
-import React from 'react'
-import assert from 'assert'
-import { shallow } from 'enzyme'
-import sinon from 'sinon'
-import proxyquire from 'proxyquire'
-
-const SendToRow = proxyquire('../send-to-row.component.js', {
-  './send-to-row.utils.js': {
-    getToErrorObject: (to, toError) => ({
-      to: to === false ? null : `mockToErrorObject:${to}${toError}`,
-    }),
-    getToWarningObject: (to, toWarning) => ({
-      to: to === false ? null : `mockToWarningObject:${to}${toWarning}`,
-    }),
-  },
-}).default
-
-import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component'
-import EnsInput from '../../../../ens-input'
-
-const propsMethodSpies = {
-  closeToDropdown: sinon.spy(),
-  openToDropdown: sinon.spy(),
-  updateGas: sinon.spy(),
-  updateSendTo: sinon.spy(),
-  updateSendToError: sinon.spy(),
-  updateSendToWarning: sinon.spy(),
-}
-
-sinon.spy(SendToRow.prototype, 'handleToChange')
-
-describe('SendToRow Component', function () {
-  let wrapper
-  let instance
-
-  beforeEach(() => {
-    wrapper = shallow(<SendToRow
-      closeToDropdown={propsMethodSpies.closeToDropdown}
-      inError={false}
-      inWarning={false}
-      network={'mockNetwork'}
-      openToDropdown={propsMethodSpies.openToDropdown}
-      to={'mockTo'}
-      toAccounts={['mockAccount']}
-      toDropdownOpen={false}
-      updateGas={propsMethodSpies.updateGas}
-      updateSendTo={propsMethodSpies.updateSendTo}
-      updateSendToError={propsMethodSpies.updateSendToError}
-      updateSendToWarning={propsMethodSpies.updateSendToWarning}
-    />, { context: { t: str => str + '_t' } })
-    instance = wrapper.instance()
-  })
-
-  afterEach(() => {
-    propsMethodSpies.closeToDropdown.resetHistory()
-    propsMethodSpies.openToDropdown.resetHistory()
-    propsMethodSpies.updateSendTo.resetHistory()
-    propsMethodSpies.updateSendToError.resetHistory()
-    propsMethodSpies.updateSendToWarning.resetHistory()
-    SendToRow.prototype.handleToChange.resetHistory()
-  })
-
-  describe('handleToChange', () => {
-
-    it('should call updateSendTo', () => {
-      assert.equal(propsMethodSpies.updateSendTo.callCount, 0)
-      instance.handleToChange('mockTo2', 'mockNickname')
-      assert.equal(propsMethodSpies.updateSendTo.callCount, 1)
-      assert.deepEqual(
-        propsMethodSpies.updateSendTo.getCall(0).args,
-        ['mockTo2', 'mockNickname']
-      )
-    })
-
-    it('should call updateSendToError', () => {
-      assert.equal(propsMethodSpies.updateSendToError.callCount, 0)
-      instance.handleToChange('mockTo2', '', 'mockToError')
-      assert.equal(propsMethodSpies.updateSendToError.callCount, 1)
-      assert.deepEqual(
-        propsMethodSpies.updateSendToError.getCall(0).args,
-        [{ to: 'mockToErrorObject:mockTo2mockToError' }]
-      )
-    })
-
-    it('should call updateSendToWarning', () => {
-      assert.equal(propsMethodSpies.updateSendToWarning.callCount, 0)
-      instance.handleToChange('mockTo2', '', '', 'mockToWarning')
-      assert.equal(propsMethodSpies.updateSendToWarning.callCount, 1)
-      assert.deepEqual(
-        propsMethodSpies.updateSendToWarning.getCall(0).args,
-        [{ to: 'mockToWarningObject:mockTo2mockToWarning' }]
-      )
-    })
-
-    it('should not call updateGas if there is a to error', () => {
-      assert.equal(propsMethodSpies.updateGas.callCount, 0)
-      instance.handleToChange('mockTo2')
-      assert.equal(propsMethodSpies.updateGas.callCount, 0)
-    })
-
-    it('should call updateGas if there is no to error', () => {
-      assert.equal(propsMethodSpies.updateGas.callCount, 0)
-      instance.handleToChange(false)
-      assert.equal(propsMethodSpies.updateGas.callCount, 1)
-    })
-  })
-
-  describe('render', () => {
-    it('should render a SendRowWrapper component', () => {
-      assert.equal(wrapper.find(SendRowWrapper).length, 1)
-    })
-
-    it('should pass the correct props to SendRowWrapper', () => {
-      const {
-        errorType,
-        label,
-        showError,
-      } = wrapper.find(SendRowWrapper).props()
-
-      assert.equal(errorType, 'to')
-
-      assert.equal(label, 'to_t: ')
-
-      assert.equal(showError, false)
-    })
-
-    it('should render an EnsInput as a child of the SendRowWrapper', () => {
-      assert(wrapper.find(SendRowWrapper).childAt(0).is(EnsInput))
-    })
-
-    it('should render the EnsInput with the correct props', () => {
-      const {
-        accounts,
-        closeDropdown,
-        dropdownOpen,
-        inError,
-        name,
-        network,
-        onChange,
-        openDropdown,
-        placeholder,
-        to,
-      } = wrapper.find(SendRowWrapper).childAt(0).props()
-      assert.deepEqual(accounts, ['mockAccount'])
-      assert.equal(dropdownOpen, false)
-      assert.equal(inError, false)
-      assert.equal(name, 'address')
-      assert.equal(network, 'mockNetwork')
-      assert.equal(placeholder, 'recipientAddress_t')
-      assert.equal(to, 'mockTo')
-      assert.equal(propsMethodSpies.closeToDropdown.callCount, 0)
-      closeDropdown()
-      assert.equal(propsMethodSpies.closeToDropdown.callCount, 1)
-      assert.equal(propsMethodSpies.openToDropdown.callCount, 0)
-      openDropdown()
-      assert.equal(propsMethodSpies.openToDropdown.callCount, 1)
-      assert.equal(SendToRow.prototype.handleToChange.callCount, 0)
-      onChange({ toAddress: 'mockNewTo', nickname: 'mockNewNickname', toError: 'mockToError', toWarning: 'mockToWarning' })
-      assert.equal(SendToRow.prototype.handleToChange.callCount, 1)
-      assert.deepEqual(
-        SendToRow.prototype.handleToChange.getCall(0).args,
-        ['mockNewTo', 'mockNewNickname', 'mockToError', 'mockToWarning', 'mockNetwork' ]
-      )
-    })
-  })
-})
-- 
cgit