diff options
author | Thomas Huang <thomas.b.huang@gmail.com> | 2017-05-05 05:35:10 +0800 |
---|---|---|
committer | Thomas Huang <thomas.b.huang@gmail.com> | 2017-05-05 05:35:10 +0800 |
commit | 0b13429daf00ddd5bdf2705c7a95d7a9d5792f54 (patch) | |
tree | f249d8deb5fa48db54d70757de944b2c8ff76a2e /test/unit/message-manager-test.js | |
parent | 8f5334e4aca8b95963f57b0fbf862256b692dbd9 (diff) | |
download | tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.gz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.bz2 tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.lz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.xz tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.tar.zst tangerine-wallet-browser-0b13429daf00ddd5bdf2705c7a95d7a9d5792f54.zip |
Lint tests
Diffstat (limited to 'test/unit/message-manager-test.js')
-rw-r--r-- | test/unit/message-manager-test.js | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/test/unit/message-manager-test.js b/test/unit/message-manager-test.js index faf7429d4..44190c8d0 100644 --- a/test/unit/message-manager-test.js +++ b/test/unit/message-manager-test.js @@ -1,29 +1,29 @@ const assert = require('assert') -const extend = require('xtend') -const EventEmitter = require('events') +// const extend = require('xtend') +// const EventEmitter = require('events') const MessageManger = require('../../app/scripts/lib/message-manager') -describe('Transaction Manager', function() { +describe('Transaction Manager', function () { let messageManager - beforeEach(function() { - messageManager = new MessageManger () + beforeEach(function () { + messageManager = new MessageManger() }) - describe('#getMsgList', function() { - it('when new should return empty array', function() { + describe('#getMsgList', function () { + it('when new should return empty array', function () { var result = messageManager.messages assert.ok(Array.isArray(result)) assert.equal(result.length, 0) }) - it('should also return transactions from local storage if any', function() { + it('should also return transactions from local storage if any', function () { }) }) - describe('#addMsg', function() { - it('adds a Msg returned in getMsgList', function() { + describe('#addMsg', function () { + it('adds a Msg returned in getMsgList', function () { var Msg = { id: 1, status: 'approved', metamaskNetworkId: 'unit test' } messageManager.addMsg(Msg) var result = messageManager.messages @@ -33,8 +33,8 @@ describe('Transaction Manager', function() { }) }) - describe('#setMsgStatusApproved', function() { - it('sets the Msg status to approved', function() { + describe('#setMsgStatusApproved', function () { + it('sets the Msg status to approved', function () { var Msg = { id: 1, status: 'unapproved', metamaskNetworkId: 'unit test' } messageManager.addMsg(Msg) messageManager.setMsgStatusApproved(1) @@ -45,8 +45,8 @@ describe('Transaction Manager', function() { }) }) - describe('#rejectMsg', function() { - it('sets the Msg status to rejected', function() { + describe('#rejectMsg', function () { + it('sets the Msg status to rejected', function () { var Msg = { id: 1, status: 'unapproved', metamaskNetworkId: 'unit test' } messageManager.addMsg(Msg) messageManager.rejectMsg(1) @@ -57,8 +57,8 @@ describe('Transaction Manager', function() { }) }) - describe('#_updateMsg', function() { - it('replaces the Msg with the same id', function() { + describe('#_updateMsg', function () { + it('replaces the Msg with the same id', function () { messageManager.addMsg({ id: '1', status: 'unapproved', metamaskNetworkId: 'unit test' }) messageManager.addMsg({ id: '2', status: 'approved', metamaskNetworkId: 'unit test' }) messageManager._updateMsg({ id: '1', status: 'blah', hash: 'foo', metamaskNetworkId: 'unit test' }) @@ -67,19 +67,19 @@ describe('Transaction Manager', function() { }) }) - describe('#getUnapprovedMsgs', function() { - it('returns unapproved Msgs in a hash', function() { + describe('#getUnapprovedMsgs', function () { + it('returns unapproved Msgs in a hash', function () { messageManager.addMsg({ id: '1', status: 'unapproved', metamaskNetworkId: 'unit test' }) messageManager.addMsg({ id: '2', status: 'approved', metamaskNetworkId: 'unit test' }) - let result = messageManager.getUnapprovedMsgs() + const result = messageManager.getUnapprovedMsgs() assert.equal(typeof result, 'object') assert.equal(result['1'].status, 'unapproved') assert.equal(result['2'], undefined) }) }) - describe('#getMsg', function() { - it('returns a Msg with the requested id', function() { + describe('#getMsg', function () { + it('returns a Msg with the requested id', function () { messageManager.addMsg({ id: '1', status: 'unapproved', metamaskNetworkId: 'unit test' }) messageManager.addMsg({ id: '2', status: 'approved', metamaskNetworkId: 'unit test' }) assert.equal(messageManager.getMsg('1').status, 'unapproved') |