fix lint test

This commit is contained in:
Victor Baranov 2019-06-19 00:28:10 +03:00
parent bf70685035
commit 75ed7e033e
5 changed files with 43 additions and 3051 deletions

View File

@ -1,6 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const connect = require('react-redux').connect
import PropTypes from 'prop-types'
const actions = require('../../ui/app/actions')
const LoadingIndicator = require('./components/loading')
const Web3 = require('web3')
@ -22,6 +23,10 @@ class ConfigScreen extends Component {
}
}
static propTypes = {
dispatch: PropTypes.func,
}
render () {
const state = this.props
const metamaskState = state.metamask

3063
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -143,7 +143,6 @@
"gulp-autoprefixer": "^5.0.0",
"gulp-sass": "^4.0.0",
"human-standard-token-abi": "^2.0.0",
"i": "^0.3.6",
"idb-global": "^2.1.0",
"iframe-stream": "^3.0.0",
"inject-css": "^0.1.1",
@ -158,7 +157,6 @@
"metamask-inpage-provider": "^1.2.2",
"mkdirp": "^0.5.1",
"multihashes": "^0.4.12",
"npm": "^6.9.0",
"number-to-bn": "^1.7.0",
"obj-multiplex": "^1.0.0",
"obs-store": "^3.0.2",

View File

@ -2,6 +2,7 @@ import React from 'react'
import assert from 'assert'
import additions from 'react-testutils-additions'
import TestRenderer from 'react-test-renderer'
import ReactTestUtils from 'react-dom/test-utils'
import { BN } from 'ethereumjs-util'
@ -9,7 +10,6 @@ import BnInput from '../../../old-ui/app/components/bn-as-decimal-input'
describe('BnInput', function () {
it('can tolerate a gas decimal number at a high precision', function (done) {
// const renderer = ReactTestUtils.createRenderer()
let valueStr = '20'
while (valueStr.length < 20) {
@ -40,7 +40,7 @@ describe('BnInput', function () {
onChange,
}}/>
const component = additions.renderIntoDocument(inputComponent)
ReactTestUtils.mockComponent(inputComponent)
TestRenderer.create(inputComponent)
const input = additions.find(component, 'input.hex-input')[0]
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
value: inputStr,
@ -49,7 +49,6 @@ describe('BnInput', function () {
})
it('can tolerate wei precision', function (done) {
// const renderer = ReactTestUtils.createRenderer()
const valueStr = '1000000000'
@ -64,25 +63,24 @@ describe('BnInput', function () {
const precision = 9 // gwei precision
const scale = 9
const props = {
const inputComponent = <BnInput {...{
value,
scale,
precision,
onChange: (newBn) => {
assert.equal(newBn.toString(), target.toString(), 'should tolerate increase')
const reInput = BnInput.downsize(newBn.toString(), 9, 9)
const reInput = this.downsize(newBn.toString(), 9, 9)
assert.equal(reInput.toString(), inputStr, 'should tolerate increase')
done()
},
}
}}/>
const inputComponent = <BnInput {...{props}}/>
const component = additions.renderIntoDocument(inputComponent)
ReactTestUtils.mockComponent(inputComponent)
TestRenderer.create(inputComponent)
const input = additions.find(component, 'input.hex-input')[0]
ReactTestUtils.Simulate.change(input, { preventDefault () {}, target: {
value: inputStr,
checkValidity () { return true } },
})
})
})
})

View File

@ -8,7 +8,7 @@ const isMobileView = require('../../../lib/is-mobile-view')
const { getEnvironmentType } = require('../../../../app/scripts/lib/util')
const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums')
//Modal Components
// Modal Components
const BuyOptions = require('./buy-options-modal')
const DepositEtherModal = require('./deposit-ether-modal')
const AccountDetailsModal = require('./account-details-modal')
@ -64,7 +64,7 @@ const accountModalStyle = {
},
laptopModalStyle: {
width: '360px',
top: 'calc(33% + 45px)',
// top: 'calc(33% + 45px)',
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
borderRadius: '4px',
top: '10%',
@ -155,7 +155,7 @@ const MODALS = {
},
laptopModalStyle: {
width: '375px',
top: 'calc(30% + 10px)',
// top: 'calc(30% + 10px)',
top: '10%',
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px',
transform: 'none',
@ -271,7 +271,7 @@ const MODALS = {
},
laptopModalStyle: {
width: '449px',
top: 'calc(33% + 45px)',
// top: 'calc(33% + 45px)',
top: '10%',
transform: 'none',
left: '0',