mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add basic tests.
This commit is contained in:
parent
2ab86b001d
commit
dc2d614da6
28
test/unit/address-book-controller.js
Normal file
28
test/unit/address-book-controller.js
Normal file
@ -0,0 +1,28 @@
|
||||
const assert = require('assert')
|
||||
const extend = require('xtend')
|
||||
const AddressBookController = require('../../app/scripts/controllers/address-book')
|
||||
|
||||
describe('address-book-controller', function() {
|
||||
var addressBookController
|
||||
|
||||
beforeEach(function() {
|
||||
addressBookController = new AddressBookController()
|
||||
})
|
||||
|
||||
describe('addres book management', function () {
|
||||
describe('#_getAddressBook', function () {
|
||||
it('should be empty by default.', function () {
|
||||
assert.equal(addressBookController._getAddressBook().length, 0)
|
||||
})
|
||||
})
|
||||
describe('#setAddressBook', function () {
|
||||
it('should properly set a new address.', function () {
|
||||
addressBookController.setAddressBook('0x01234', 'test')
|
||||
var addressBook = addressBookController._getAddressBook()
|
||||
assert.equal(addressBook.length, 1, 'incorrect address book length.')
|
||||
assert.equal(addressBook[0].address, '0x01234', 'incorrect addresss')
|
||||
assert.equal(addressBook[0].name, 'test', 'incorrect nickname')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
@ -7,7 +7,7 @@ const rp = require('request-promise')
|
||||
const nock = require('nock')
|
||||
const CurrencyController = require('../../app/scripts/controllers/currency')
|
||||
|
||||
describe('config-manager', function() {
|
||||
describe('currency-controller', function() {
|
||||
var currencyController
|
||||
|
||||
beforeEach(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user