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

Skip jazzicons in unit tests

This commit is contained in:
Dan Finlay 2017-05-15 14:35:24 -07:00
parent 19db11856b
commit c4be4c7195
2 changed files with 11 additions and 4 deletions

View File

@ -57,6 +57,7 @@
"debounce": "^1.0.0", "debounce": "^1.0.0",
"deep-extend": "^0.4.1", "deep-extend": "^0.4.1",
"denodeify": "^1.2.1", "denodeify": "^1.2.1",
"detect-node": "^2.0.3",
"disc": "^1.3.2", "disc": "^1.3.2",
"dnode": "^1.2.2", "dnode": "^1.2.2",
"end-of-stream": "^1.1.0", "end-of-stream": "^1.1.0",
@ -169,6 +170,7 @@
"qunit": "^0.9.1", "qunit": "^0.9.1",
"react-addons-test-utils": "^15.5.1", "react-addons-test-utils": "^15.5.1",
"react-dom": "^15.5.4", "react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"react-testutils-additions": "^15.2.0", "react-testutils-additions": "^15.2.0",
"sinon": "^1.17.3", "sinon": "^1.17.3",
"tape": "^4.5.1", "tape": "^4.5.1",

View File

@ -1,6 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const isNode = require('detect-node')
const findDOMNode = require('react-dom').findDOMNode const findDOMNode = require('react-dom').findDOMNode
const jazzicon = require('jazzicon') const jazzicon = require('jazzicon')
const iconFactoryGen = require('../../lib/icon-factory') const iconFactoryGen = require('../../lib/icon-factory')
@ -40,9 +41,11 @@ IdenticonComponent.prototype.componentDidMount = function () {
var container = findDOMNode(this) var container = findDOMNode(this)
var diameter = props.diameter || this.defaultDiameter var diameter = props.diameter || this.defaultDiameter
if (!isNode) {
var img = iconFactory.iconForAddress(address, diameter, false) var img = iconFactory.iconForAddress(address, diameter, false)
container.appendChild(img) container.appendChild(img)
} }
}
IdenticonComponent.prototype.componentDidUpdate = function () { IdenticonComponent.prototype.componentDidUpdate = function () {
var props = this.props var props = this.props
@ -58,6 +61,8 @@ IdenticonComponent.prototype.componentDidUpdate = function () {
} }
var diameter = props.diameter || this.defaultDiameter var diameter = props.diameter || this.defaultDiameter
if (!isNode) {
var img = iconFactory.iconForAddress(address, diameter, false) var img = iconFactory.iconForAddress(address, diameter, false)
container.appendChild(img) container.appendChild(img)
} }
}