diff options
Diffstat (limited to 'test/unit/app/controllers/blacklist-controller-test.js')
-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 08564177..7a14c02c 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) + }) }) }) |