Linted and removed unused deps

This commit is contained in:
Dan Finlay 2017-05-16 16:19:10 -07:00
parent a15e753c80
commit caeadc2407
2 changed files with 8 additions and 16 deletions

View File

@ -136,7 +136,6 @@
"browserify": "^13.0.0",
"chai": "^3.5.0",
"clone": "^1.0.2",
"create-react-factory": "^0.2.1",
"deep-freeze-strict": "^1.1.1",
"del": "^2.2.0",
"envify": "^4.0.0",

View File

@ -2,15 +2,10 @@ const assert = require('assert')
const additions = require('react-testutils-additions')
const h = require('react-hyperscript')
const PendingTx = require('../../../ui/app/components/pending-tx')
const createReactFactory = require('create-react-factory').createReactFactory
const React = require('react')
const shallow = require('react-test-renderer/shallow')
const Factory = createReactFactory(PendingTx)
const ReactTestUtils = require('react-addons-test-utils')
const ethUtil = require('ethereumjs-util')
describe('PendingTx', function () {
let pendingTxComponent
const identities = {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b826': {
@ -38,7 +33,7 @@ describe('PendingTx', function () {
it('should use updated values when edited.', function (done) {
const renderer = ReactTestUtils.createRenderer();
const renderer = ReactTestUtils.createRenderer()
const newGasPrice = '0x77359400'
const props = {
@ -56,16 +51,14 @@ describe('PendingTx', function () {
}
const pendingTxComponent = h(PendingTx, props)
const component = additions.renderIntoDocument(pendingTxComponent);
const component = additions.renderIntoDocument(pendingTxComponent)
renderer.render(pendingTxComponent)
const result = renderer.getRenderOutput()
const form = result.props.children
const children = form.props.children[form.props.children.length - 1]
assert.equal(result.type, 'div', 'should create a div')
try{
const input = additions.find(component, '.cell.row input[type="number"]')[1]
try {
const input = additions.find(component, '.cell.row input[type='number']')[1]
ReactTestUtils.Simulate.change(input, {
target: {
value: 2,
@ -76,14 +69,14 @@ describe('PendingTx', function () {
let form = additions.find(component, 'form')[0]
form.checkValidity = () => true
form.getFormEl = () => { return { checkValidity() { return true } } }
ReactTestUtils.Simulate.submit(form, { preventDefault() {}, target: { checkValidity() {return true} } })
ReactTestUtils.Simulate.submit(form, { preventDefault() {}, target: { checkValidity() {
return true
} } })
} catch (e) {
console.log("WHAAAA")
console.log('WHAAAA')
console.error(e)
}
})
})