diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-17 13:44:28 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-17 13:44:28 +0800 |
commit | e89350b19fdac56968303e5c48806a4605fb4b22 (patch) | |
tree | 22cc942a6f81459cb47c96ea7cb2b95abb04e162 /test | |
parent | de4265c629f8e68d882c2ded0e20417327cf4d2f (diff) | |
download | tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar.gz tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar.bz2 tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar.lz tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar.xz tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.tar.zst tangerine-wallet-browser-e89350b19fdac56968303e5c48806a4605fb4b22.zip |
added tests for removeAccount
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/app/controllers/metamask-controller-test.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index a08371f86..9164fe246 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -485,6 +485,39 @@ describe('MetaMaskController', function () { }) }) + describe('#removeAccount', function () { + let ret + const addressToRemove = '0x1' + + beforeEach(async function () { + sinon.stub(metamaskController.preferencesController, 'removeAddress') + sinon.stub(metamaskController.accountTracker, 'removeAccount') + sinon.stub(metamaskController.keyringController, 'removeAccount') + + ret = await metamaskController.removeAccount(addressToRemove) + + }) + + afterEach(function () { + metamaskController.keyringController.removeAccount.restore() + metamaskController.accountTracker.removeAccount.restore() + metamaskController.preferencesController.removeAddress.restore() + }) + + it('should call preferencesController.removeAddress', async function () { + assert(metamaskController.preferencesController.removeAddress.calledWith(addressToRemove)) + }) + it('should call accountTracker.removeAccount', async function () { + assert(metamaskController.accountTracker.removeAccount.calledWith(addressToRemove)) + }) + it('should call keyringController.removeAccount', async function () { + assert(metamaskController.keyringController.removeAccount.calledWith(addressToRemove)) + }) + it('should return address', async function () { + assert.equal(ret, '0x1') + }) + }) + describe('#clearSeedWordCache', function () { it('should have set seed words', function () { |