aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-11 01:52:05 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-11 01:52:05 +0800
commitdc2d614da68ca851c3b1c0c108e7c2f22185751c (patch)
treeaf3e6a57b78e96b5d2222286acd5a4a3339dc01d /test
parent2ab86b001dfc4ade4fc6df030175e64359b757e6 (diff)
downloadtangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.gz
tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.tar.zst
tangerine-wallet-browser-dc2d614da68ca851c3b1c0c108e7c2f22185751c.zip
Add basic tests.
Diffstat (limited to 'test')
-rw-r--r--test/unit/address-book-controller.js28
-rw-r--r--test/unit/currency-controller-test.js2
2 files changed, 29 insertions, 1 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')
+ })
+ })
+ })
+})
diff --git a/test/unit/currency-controller-test.js b/test/unit/currency-controller-test.js
index dd7fa91e0..079f8b488 100644
--- a/test/unit/currency-controller-test.js
+++ b/test/unit/currency-controller-test.js
@@ -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() {