diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-02 06:58:46 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-02 21:13:46 +0800 |
commit | 4dd6c8168f3dbec5a0e910069a4a29a640e39942 (patch) | |
tree | 75f720e1871414cd582a8b7c390fc1ea423579e0 /test/unit/app | |
parent | 343ae7c143c4a729e2d94cf6dd95661d2e5f73ba (diff) | |
download | tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar.gz tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar.bz2 tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar.lz tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar.xz tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.tar.zst tangerine-wallet-browser-4dd6c8168f3dbec5a0e910069a4a29a640e39942.zip |
Add ability to whitelist a blacklisted domain at runtime
Diffstat (limited to 'test/unit/app')
-rw-r--r-- | test/unit/app/controllers/blacklist-controller-test.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/app/controllers/blacklist-controller-test.js b/test/unit/app/controllers/blacklist-controller-test.js index 085641777..7a14c02cc 100644 --- a/test/unit/app/controllers/blacklist-controller-test.js +++ b/test/unit/app/controllers/blacklist-controller-test.js @@ -8,6 +8,16 @@ describe('blacklist controller', function () { blacklistController = new BlacklistController() }) + describe('whitelistDomain', function () { + it('should add hostname to the runtime whitelist', function () { + blacklistController.whitelistDomain('foo.com') + assert.deepEqual(blacklistController.store.getState().whitelist, ['foo.com']) + + blacklistController.whitelistDomain('bar.com') + assert.deepEqual(blacklistController.store.getState().whitelist, ['bar.com', 'foo.com']) + }) + }) + describe('checkForPhishing', function () { it('should not flag whitelisted values', function () { const result = blacklistController.checkForPhishing('www.metamask.io') @@ -37,5 +47,10 @@ describe('blacklist controller', function () { const result = blacklistController.checkForPhishing('zero-faucet.metamask.io') assert.equal(result, false) }) + it('should not flag whitelisted domain', function () { + blacklistController.whitelistDomain('metamask.com') + const result = blacklistController.checkForPhishing('metamask.com') + assert.equal(result, false) + }) }) }) |