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

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", "browserify": "^13.0.0",
"chai": "^3.5.0", "chai": "^3.5.0",
"clone": "^1.0.2", "clone": "^1.0.2",
"create-react-factory": "^0.2.1",
"deep-freeze-strict": "^1.1.1", "deep-freeze-strict": "^1.1.1",
"del": "^2.2.0", "del": "^2.2.0",
"envify": "^4.0.0", "envify": "^4.0.0",

View File

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