1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/test/unit/components/binary-renderer-test.js
anticlimactic a1db40047c Remove unused files from ui folder. (#3577)
* Removed unused UI files. Fixes #3434.

* Reverted the deletion of "feature-toggle-utils.js". Reverted the deletion of the test files and modified the paths so they referred to the old-ui.
2018-03-19 12:41:24 -02:30

24 lines
646 B
JavaScript

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)
})
})