diff options
author | kumavis <aaron@kumavis.me> | 2018-10-30 08:25:05 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-10-30 08:25:05 +0800 |
commit | ccbc2332829569b6bb416ced624ee3123c54b939 (patch) | |
tree | b865d8b499a00921b4b38f2839dfc6c631aa4666 /ui/app/components/identicon/tests | |
parent | f0602ca354a6d352c13a79a1cba884f54e5b9a83 (diff) | |
parent | 1bb4a8428c73c1f1137793b25900db159eec3fa8 (diff) | |
download | tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.tar.gz tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.tar.zst tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.zip |
Merge branch 'develop' of github.com:MetaMask/metamask-extension into sentry-enhancements2
Diffstat (limited to 'ui/app/components/identicon/tests')
-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') + }) +}) |