diff options
author | kumavis <aaron@kumavis.me> | 2017-08-04 06:05:32 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-08-04 06:05:32 +0800 |
commit | da16f396266daa5ab0acc8f0c04d3e25b98c39f0 (patch) | |
tree | 44fad3fc645ac8165e4832259d8c6fe43196bccb /test/unit/blacklist-controller-test.js | |
parent | da7471e0958d30b4465ef35090dbfa05b85471f0 (diff) | |
download | tangerine-wallet-browser-da16f396266daa5ab0acc8f0c04d3e25b98c39f0.tar.gz tangerine-wallet-browser-da16f396266daa5ab0acc8f0c04d3e25b98c39f0.tar.zst tangerine-wallet-browser-da16f396266daa5ab0acc8f0c04d3e25b98c39f0.zip |
Merge branch 'master' of github.com:MetaMask/metamask-extension into greenkeeper/initial
Diffstat (limited to 'test/unit/blacklist-controller-test.js')
-rw-r--r-- | test/unit/blacklist-controller-test.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/unit/blacklist-controller-test.js b/test/unit/blacklist-controller-test.js new file mode 100644 index 000000000..a9260466f --- /dev/null +++ b/test/unit/blacklist-controller-test.js @@ -0,0 +1,41 @@ +const assert = require('assert') +const BlacklistController = require('../../app/scripts/controllers/blacklist') + +describe('blacklist controller', function () { + let blacklistController + + before(() => { + blacklistController = new BlacklistController() + }) + + describe('checkForPhishing', function () { + it('should not flag whitelisted values', function () { + const result = blacklistController.checkForPhishing('www.metamask.io') + assert.equal(result, false) + }) + it('should flag explicit values', function () { + const result = blacklistController.checkForPhishing('metamask.com') + assert.equal(result, true) + }) + it('should flag levenshtein values', function () { + const result = blacklistController.checkForPhishing('metmask.io') + assert.equal(result, true) + }) + it('should not flag not-even-close values', function () { + const result = blacklistController.checkForPhishing('example.com') + assert.equal(result, false) + }) + it('should not flag the ropsten faucet domains', function () { + const result = blacklistController.checkForPhishing('faucet.metamask.io') + assert.equal(result, false) + }) + it('should not flag the mascara domain', function () { + const result = blacklistController.checkForPhishing('zero.metamask.io') + assert.equal(result, false) + }) + it('should not flag the mascara-faucet domain', function () { + const result = blacklistController.checkForPhishing('zero-faucet.metamask.io') + assert.equal(result, false) + }) + }) +})
\ No newline at end of file |