diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-11 01:52:05 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-03-11 01:52:05 +0800 |
commit | dc2d614da68ca851c3b1c0c108e7c2f22185751c (patch) | |
tree | af3e6a57b78e96b5d2222286acd5a4a3339dc01d /test/unit/address-book-controller.js | |
parent | 2ab86b001dfc4ade4fc6df030175e64359b757e6 (diff) | |
download | tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.gz tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.bz2 tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.lz tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.xz tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.zst tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.zip |
Add basic tests.
Diffstat (limited to 'test/unit/address-book-controller.js')
-rw-r--r-- | test/unit/address-book-controller.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/address-book-controller.js b/test/unit/address-book-controller.js new file mode 100644 index 000000000..f00547167 --- /dev/null +++ b/test/unit/address-book-controller.js @@ -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') + }) + }) + }) +}) |