diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-09-01 03:32:26 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-09-13 10:48:51 +0800 |
commit | 63ba6d1df4c98bd94f46e979bdffb38fe019aa51 (patch) | |
tree | 6e48e2363f8d3202eba10aba3010cde9eb0c0676 /ui/app/components/hex-to-decimal/tests | |
parent | 18c94c4ac9a2e6981bb9dedc49b7351582153707 (diff) | |
download | tangerine-wallet-browser-63ba6d1df4c98bd94f46e979bdffb38fe019aa51.tar.gz tangerine-wallet-browser-63ba6d1df4c98bd94f46e979bdffb38fe019aa51.tar.zst tangerine-wallet-browser-63ba6d1df4c98bd94f46e979bdffb38fe019aa51.zip |
Add HexToDecimal component
Diffstat (limited to 'ui/app/components/hex-to-decimal/tests')
-rw-r--r-- | ui/app/components/hex-to-decimal/tests/hex-to-decimal.component.test.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/app/components/hex-to-decimal/tests/hex-to-decimal.component.test.js b/ui/app/components/hex-to-decimal/tests/hex-to-decimal.component.test.js new file mode 100644 index 000000000..c98da9ad4 --- /dev/null +++ b/ui/app/components/hex-to-decimal/tests/hex-to-decimal.component.test.js @@ -0,0 +1,26 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import HexToDecimal from '../hex-to-decimal.component' + +describe('HexToDecimal Component', () => { + it('should render a prefixed hex as a decimal with a className', () => { + const wrapper = shallow(<HexToDecimal + value="0x3039" + className="hex-to-decimal" + />) + + assert.ok(wrapper.hasClass('hex-to-decimal')) + assert.equal(wrapper.text(), '12345') + }) + + it('should render an unprefixed hex as a decimal with a className', () => { + const wrapper = shallow(<HexToDecimal + value="1A85" + className="hex-to-decimal" + />) + + assert.ok(wrapper.hasClass('hex-to-decimal')) + assert.equal(wrapper.text(), '6789') + }) +}) |