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

24 lines
647 B

var assert = require('assert')
var BinaryRenderer = require('../../../old-ui/app/components/binary-renderer')
8 years ago
describe('BinaryRenderer', function () {
let binaryRenderer
const message = 'Hello, world!'
const buffer = Buffer.from(message, 'utf8')
const hex = buffer.toString('hex')
8 years ago
beforeEach(function () {
binaryRenderer = new BinaryRenderer()
})
8 years ago
it('recovers message', function () {
const result = binaryRenderer.hexToText(hex)
assert.equal(result, message)
})
8 years ago
it('recovers message with hex prefix', function () {
const result = binaryRenderer.hexToText('0x' + hex)
assert.equal(result, message)
})
})