aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/blacklist-controller-test.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-05-23 04:20:04 +0800
committerkumavis <aaron@kumavis.me>2018-05-23 04:20:04 +0800
commit3a80f3dd836889b7e4f4d4db8eaf42883623d9bf (patch)
treebcde7f3a6acbdf311bf66b70be6bfac2b3ed088a /test/unit/app/controllers/blacklist-controller-test.js
parent3084dc47d10e3e455c924e5aad0b0961c500ec8d (diff)
parentcee55b47d03006630b1dbe038c6008654ca8f674 (diff)
downloadtangerine-wallet-browser-3a80f3dd836889b7e4f4d4db8eaf42883623d9bf.tar.gz
tangerine-wallet-browser-3a80f3dd836889b7e4f4d4db8eaf42883623d9bf.tar.zst
tangerine-wallet-browser-3a80f3dd836889b7e4f4d4db8eaf42883623d9bf.zip
Merge branch 'develop' of github.com:MetaMask/metamask-extension into network-remove-provider-engine
Diffstat (limited to 'test/unit/app/controllers/blacklist-controller-test.js')
-rw-r--r--test/unit/app/controllers/blacklist-controller-test.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/unit/app/controllers/blacklist-controller-test.js b/test/unit/app/controllers/blacklist-controller-test.js
new file mode 100644
index 000000000..085641777
--- /dev/null
+++ b/test/unit/app/controllers/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)
+ })
+ })
+})