1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Lint fixes

This commit is contained in:
Dan 2018-05-14 07:01:41 -02:30
parent 145e53b404
commit c2ed2d4e50
10 changed files with 6 additions and 31 deletions

View File

@ -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(() => {

View File

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

View File

@ -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')

View File

@ -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(() => {

View File

@ -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:')

View File

@ -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)

View File

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

View File

@ -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(() => {

View File

@ -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(() => {

View File

@ -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(() => {