A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
ciphermask/test/unit/components/binary-renderer-test.js

23 lines
646 B

var assert = require('assert')
var BinaryRenderer = require('../../../old-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)
})
})