From c47f7f6a765e748c33ffde6ff38e881199251eda Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 10 Mar 2017 10:34:18 -0800 Subject: [PATCH] Add another test for duplicates. --- test/unit/address-book-controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit/address-book-controller.js b/test/unit/address-book-controller.js index f00547167..51dc898b8 100644 --- a/test/unit/address-book-controller.js +++ b/test/unit/address-book-controller.js @@ -23,6 +23,13 @@ describe('address-book-controller', function() { assert.equal(addressBook[0].address, '0x01234', 'incorrect addresss') assert.equal(addressBook[0].name, 'test', 'incorrect nickname') }) + + it('should reject duplicates.', function () { + addressBookController.setAddressBook('0x01234', 'test') + addressBookController.setAddressBook('0x01234', 'test') + var addressBook = addressBookController._getAddressBook() + assert.equal(addressBook.length, 1, 'incorrect address book length.') + }) }) }) })