aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-16 05:35:24 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-16 05:35:24 +0800
commitc4be4c7195c05936fba61783b9f8a3c96d161ce0 (patch)
treed8d01add8e941ff1cc530505f73043575f2f2f26
parent19db11856bef65c38d96eb1d6084d88ab6e7eebc (diff)
downloadtangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.gz
tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.zst
tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.zip
Skip jazzicons in unit tests
-rw-r--r--package.json2
-rw-r--r--ui/app/components/identicon.js13
2 files changed, 11 insertions, 4 deletions
diff --git a/package.json b/package.json
index 2f5f8434b..9c0a91e3b 100644
--- a/package.json
+++ b/package.json
@@ -57,6 +57,7 @@
"debounce": "^1.0.0",
"deep-extend": "^0.4.1",
"denodeify": "^1.2.1",
+ "detect-node": "^2.0.3",
"disc": "^1.3.2",
"dnode": "^1.2.2",
"end-of-stream": "^1.1.0",
@@ -169,6 +170,7 @@
"qunit": "^0.9.1",
"react-addons-test-utils": "^15.5.1",
"react-dom": "^15.5.4",
+ "react-test-renderer": "^15.5.4",
"react-testutils-additions": "^15.2.0",
"sinon": "^1.17.3",
"tape": "^4.5.1",
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js
index 6d4871d02..9de854b54 100644
--- a/ui/app/components/identicon.js
+++ b/ui/app/components/identicon.js
@@ -1,6 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
+const isNode = require('detect-node')
const findDOMNode = require('react-dom').findDOMNode
const jazzicon = require('jazzicon')
const iconFactoryGen = require('../../lib/icon-factory')
@@ -40,8 +41,10 @@ IdenticonComponent.prototype.componentDidMount = function () {
var container = findDOMNode(this)
var diameter = props.diameter || this.defaultDiameter
- var img = iconFactory.iconForAddress(address, diameter, false)
- container.appendChild(img)
+ if (!isNode) {
+ var img = iconFactory.iconForAddress(address, diameter, false)
+ container.appendChild(img)
+ }
}
IdenticonComponent.prototype.componentDidUpdate = function () {
@@ -58,6 +61,8 @@ IdenticonComponent.prototype.componentDidUpdate = function () {
}
var diameter = props.diameter || this.defaultDiameter
- var img = iconFactory.iconForAddress(address, diameter, false)
- container.appendChild(img)
+ if (!isNode) {
+ var img = iconFactory.iconForAddress(address, diameter, false)
+ container.appendChild(img)
+ }
}