diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-05-16 05:35:24 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-05-16 05:35:24 +0800 |
commit | c4be4c7195c05936fba61783b9f8a3c96d161ce0 (patch) | |
tree | d8d01add8e941ff1cc530505f73043575f2f2f26 /ui | |
parent | 19db11856bef65c38d96eb1d6084d88ab6e7eebc (diff) | |
download | tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.gz tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.bz2 tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.lz tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.xz tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.tar.zst tangerine-wallet-browser-c4be4c7195c05936fba61783b9f8a3c96d161ce0.zip |
Skip jazzicons in unit tests
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/identicon.js | 13 |
1 files changed, 9 insertions, 4 deletions
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) + } } |