feature/default_network_editable
Dan 7 years ago
parent 145e53b404
commit c2ed2d4e50
  1. 4
      ui/app/components/send_/account-list-item/tests/account-list-item-component.test.js
  2. 2
      ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js
  3. 3
      ui/app/components/send_/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js
  4. 2
      ui/app/components/send_/send-content/send-from-row/from-dropdown/tests/from-dropdown-component.test.js
  5. 8
      ui/app/components/send_/send-content/send-from-row/tests/send-from-row-component.test.js
  6. 10
      ui/app/components/send_/send-content/send-gas-row/tests/send-gas-row-component.test.js
  7. 2
      ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js
  8. 2
      ui/app/components/send_/send-footer/tests/send-footer-component.test.js
  9. 2
      ui/app/components/send_/send-header/tests/send-header-component.test.js
  10. 2
      ui/app/components/send_/tests/send-component.test.js

@ -7,7 +7,7 @@ import Identicon from '../../../identicon'
import CurrencyDisplay from '../../../send/currency-display'
const utilsMethodStubs = {
checksumAddress: sinon.stub().returns('mockCheckSumAddress')
checksumAddress: sinon.stub().returns('mockCheckSumAddress'),
}
const AccountListItem = proxyquire('../account-list-item.component.js', {
@ -21,7 +21,6 @@ const propsMethodSpies = {
describe('AccountListItem Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<AccountListItem
@ -34,7 +33,6 @@ describe('AccountListItem Component', function () {
handleClick={propsMethodSpies.handleClick}
icon={<i className="mockIcon" />}
/>, { context: { t: str => str + '_t' } })
instance = wrapper.instance()
})
afterEach(() => {

@ -14,8 +14,6 @@ const propsMethodSpies = {
updateSendAmountError: sinon.spy(),
}
const MOCK_EVENT = { preventDefault: () => {} }
sinon.spy(SendAmountRow.prototype, 'handleAmountChange')
sinon.spy(SendAmountRow.prototype, 'validateAmount')

@ -15,7 +15,6 @@ sinon.spy(SendDropdownList.prototype, 'getListItemIcon')
describe('SendDropdownList Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<SendDropdownList
@ -28,7 +27,6 @@ describe('SendDropdownList Component', function () {
onSelect={propsMethodSpies.onSelect}
activeAddress={'mockAddress2'}
/>, { context: { t: str => str + '_t' } })
instance = wrapper.instance()
})
afterEach(() => {
@ -81,7 +79,6 @@ describe('SendDropdownList Component', function () {
account,
className,
handleClick,
icon,
} = accountListItem.props()
assert.deepEqual(account, { address: 'mockAccount' + index })
assert.equal(className, 'account-list-item__dropdown')

@ -15,7 +15,6 @@ const propsMethodSpies = {
describe('FromDropdown Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<FromDropdown
@ -26,7 +25,6 @@ describe('FromDropdown Component', function () {
openDropdown={propsMethodSpies.openDropdown}
selectedAccount={ { address: 'mockAddress' } }
/>, { context: { t: str => str + '_t' } })
instance = wrapper.instance()
})
afterEach(() => {

@ -14,8 +14,6 @@ const propsMethodSpies = {
setSendTokenBalance: sinon.spy(),
}
const MOCK_EVENT = { preventDefault: () => {} }
sinon.spy(SendFromRow.prototype, 'handleFromChange')
describe('SendFromRow Component', function () {
@ -60,8 +58,8 @@ describe('SendFromRow Component', function () {
it('should call tokenContract.balanceOf and setSendTokenBalance if tokenContract is defined', async () => {
wrapper.setProps({
tokenContract: {
balanceOf: () => new Promise((resolve) => resolve('mockUsersToken'))
}
balanceOf: () => new Promise((resolve) => resolve('mockUsersToken')),
},
})
assert.equal(propsMethodSpies.setSendTokenBalance.callCount, 0)
await instance.handleFromChange('mockFrom')
@ -81,9 +79,7 @@ describe('SendFromRow Component', function () {
it('should pass the correct props to SendRowWrapper', () => {
const {
errorType,
label,
showError,
} = wrapper.find(SendRowWrapper).props()
assert.equal(label, 'from_t:')

@ -11,11 +11,8 @@ const propsMethodSpies = {
showCustomizeGasModal: sinon.spy(),
}
const MOCK_EVENT = { preventDefault: () => {} }
describe('SendGasRow Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<SendGasRow
@ -25,7 +22,6 @@ describe('SendGasRow Component', function () {
gasTotal={'mockGasTotal'}
showCustomizeGasModal={propsMethodSpies.showCustomizeGasModal}
/>, { context: { t: str => str + '_t' } })
instance = wrapper.instance()
})
afterEach(() => {
@ -57,10 +53,10 @@ describe('SendGasRow Component', function () {
gasTotal,
onClick,
} = wrapper.find(SendRowWrapper).childAt(0).props()
assert.equal(conversionRate,20)
assert.equal(convertedCurrency,'mockConvertedCurrency')
assert.equal(conversionRate, 20)
assert.equal(convertedCurrency, 'mockConvertedCurrency')
assert.equal(gasLoadingError, false)
assert.equal(gasTotal,'mockGasTotal')
assert.equal(gasTotal, 'mockGasTotal')
assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 0)
onClick()
assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 1)

@ -14,8 +14,6 @@ const propsMethodSpies = {
updateSendToError: sinon.spy(),
}
const MOCK_EVENT = { preventDefault: () => {} }
sinon.spy(SendToRow.prototype, 'handleToChange')
describe('SendToRow Component', function () {

@ -23,7 +23,6 @@ sinon.spy(SendFooter.prototype, 'onSubmit')
describe('SendFooter Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<SendFooter
@ -46,7 +45,6 @@ describe('SendFooter Component', function () {
unapprovedTxs={['mockTx']}
update={propsMethodSpies.update}
/>, { context: { t: str => str } })
instance = wrapper.instance()
})
afterEach(() => {

@ -18,7 +18,6 @@ sinon.spy(SendHeader.prototype, 'onClose')
describe('SendHeader Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<SendHeader
@ -26,7 +25,6 @@ describe('SendHeader Component', function () {
history={historySpies}
isToken={false}
/>, { context: { t: str => str } })
instance = wrapper.instance()
})
afterEach(() => {

@ -27,7 +27,6 @@ sinon.spy(SendTransactionScreen.prototype, 'updateGas')
describe('Send Component', function () {
let wrapper
let instance
beforeEach(() => {
wrapper = shallow(<SendTransactionScreen
@ -51,7 +50,6 @@ describe('Send Component', function () {
updateSendErrors={propsMethodSpies.updateSendErrors}
updateSendTokenBalance={propsMethodSpies.updateSendTokenBalance}
/>)
instance = wrapper.instance()
})
afterEach(() => {

Loading…
Cancel
Save