diff options
author | kumavis <aaron@kumavis.me> | 2018-10-26 10:24:30 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-10-26 10:24:30 +0800 |
commit | 9b42416fc0d92662d1a21759db357e7f439d7a7b (patch) | |
tree | 4fb658d739a7127d4c18a22b4abe556bfc3a194e /ui/app/components/identicon/tests/identicon.component.test.js | |
parent | 9b501b7c42ebebb61ac3130d1e84d36efcac9b7e (diff) | |
parent | 55c66b0d988fac6b2ed5948cf4dcd20fd486070e (diff) | |
download | tangerine-wallet-browser-9b42416fc0d92662d1a21759db357e7f439d7a7b.tar.gz tangerine-wallet-browser-9b42416fc0d92662d1a21759db357e7f439d7a7b.tar.zst tangerine-wallet-browser-9b42416fc0d92662d1a21759db357e7f439d7a7b.zip |
Merge branch 'develop' of github.com:MetaMask/metamask-extension into HowardBraham-develop
Diffstat (limited to 'ui/app/components/identicon/tests/identicon.component.test.js')
-rw-r--r-- | ui/app/components/identicon/tests/identicon.component.test.js | 51 |
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') + }) +}) |