aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/components/binary-renderer-test.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-08 02:37:31 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-08 02:37:31 +0800
commit08ca7dac5a15e104084c6da3eb6015136b316809 (patch)
tree3e0b1a61f3be3aa1e01824512b4df0a793dc6a17 /test/unit/components/binary-renderer-test.js
parent01f2ec4823e83d986e7ecfd268f6b293f38a13e8 (diff)
parent2acf991b67bc42fb904ff77af6ff6a7ca3a683fd (diff)
downloadtangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar.gz
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar.bz2
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar.lz
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar.xz
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.tar.zst
tangerine-wallet-browser-08ca7dac5a15e104084c6da3eb6015136b316809.zip
Merge branch 'master' into i1144-moarrpc
Diffstat (limited to 'test/unit/components/binary-renderer-test.js')
-rw-r--r--test/unit/components/binary-renderer-test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/components/binary-renderer-test.js b/test/unit/components/binary-renderer-test.js
new file mode 100644
index 000000000..3264faddc
--- /dev/null
+++ b/test/unit/components/binary-renderer-test.js
@@ -0,0 +1,25 @@
+var assert = require('assert')
+var BinaryRenderer = require('../../../ui/app/components/binary-renderer')
+
+describe('BinaryRenderer', function() {
+
+ let binaryRenderer
+ const message = 'Hello, world!'
+ const buffer = new Buffer(message, 'utf8')
+ const hex = buffer.toString('hex')
+
+ beforeEach(function() {
+ binaryRenderer = new BinaryRenderer()
+ })
+
+ it('recovers message', function() {
+ const result = binaryRenderer.hexToText(hex)
+ assert.equal(result, message)
+ })
+
+
+ it('recovers message with hex prefix', function() {
+ const result = binaryRenderer.hexToText('0x' + hex)
+ assert.equal(result, message)
+ })
+})