aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/identicon/tests/identicon.component.test.js
diff options
context:
space:
mode:
authorhackyminer <hackyminer@gmail.com>2018-10-26 19:37:35 +0800
committerhackyminer <hackyminer@gmail.com>2018-10-26 19:37:35 +0800
commitbc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d (patch)
tree96fc1c969b49c66081ff1a042a6e2e3e787723c7 /ui/app/components/identicon/tests/identicon.component.test.js
parentb62d07f3a5bdfde7e295f17b7f601c6f2d5314ef (diff)
parent54a8ade2669cb5f8f046509873bc2a9c25425847 (diff)
downloadtangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar.gz
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar.bz2
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar.lz
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar.xz
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.tar.zst
tangerine-wallet-browser-bc7f8d0a5bf42b73ee1d1102362fc0a94dc80c0d.zip
Merge branch 'develop' into eth_chainid
Diffstat (limited to 'ui/app/components/identicon/tests/identicon.component.test.js')
-rw-r--r--ui/app/components/identicon/tests/identicon.component.test.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/ui/app/components/identicon/tests/identicon.component.test.js b/ui/app/components/identicon/tests/identicon.component.test.js
new file mode 100644
index 000000000..2944818f5
--- /dev/null
+++ b/ui/app/components/identicon/tests/identicon.component.test.js
@@ -0,0 +1,51 @@
+import React from 'react'
+import assert from 'assert'
+import thunk from 'redux-thunk'
+import configureMockStore from 'redux-mock-store'
+import { mount } from 'enzyme'
+import Identicon from '../identicon.component'
+
+describe('Identicon', () => {
+ const state = {
+ metamask: {
+ useBlockie: false,
+ },
+ }
+
+ const middlewares = [thunk]
+ const mockStore = configureMockStore(middlewares)
+ const store = mockStore(state)
+
+ it('renders default eth_logo identicon with no props', () => {
+ const wrapper = mount(
+ <Identicon store={store}/>
+ )
+
+ assert.equal(wrapper.find('img.balance-icon').prop('src'), './images/eth_logo.svg')
+ })
+
+ it('renders custom image and add className props', () => {
+ const wrapper = mount(
+ <Identicon
+ store={store}
+ className="test-image"
+ image="test-image"
+ />
+ )
+
+ assert.equal(wrapper.find('img.test-image').prop('className'), 'identicon test-image')
+ assert.equal(wrapper.find('img.test-image').prop('src'), 'test-image')
+ })
+
+ it('renders div with address prop', () => {
+ const wrapper = mount(
+ <Identicon
+ store={store}
+ className="test-address"
+ address="0xTest"
+ />
+ )
+
+ assert.equal(wrapper.find('div.test-address').prop('className'), 'identicon test-address')
+ })
+})