From ecaa235b5e3331defab75dad72593951fdf37790 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 2 Aug 2017 14:26:10 -0700 Subject: phishing detection - move phishing detection into contentscript and metamask controller --- test/unit/blacklister-test.js | 36 ------------------------------------ test/unit/phishing-detection-test.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 test/unit/blacklister-test.js create mode 100644 test/unit/phishing-detection-test.js (limited to 'test') diff --git a/test/unit/blacklister-test.js b/test/unit/blacklister-test.js deleted file mode 100644 index ce110491c..000000000 --- a/test/unit/blacklister-test.js +++ /dev/null @@ -1,36 +0,0 @@ -const assert = require('assert') -const isPhish = require('../../app/scripts/lib/is-phish') - -describe('blacklister', function () { - describe('#isPhish', function () { - it('should not flag whitelisted values', function () { - var result = isPhish({ hostname: 'www.metamask.io' }) - assert.equal(result, false) - }) - it('should flag explicit values', function () { - var result = isPhish({ hostname: 'metamask.com' }) - assert.equal(result, true) - }) - it('should flag levenshtein values', function () { - var result = isPhish({ hostname: 'metmask.io' }) - assert.equal(result, true) - }) - it('should not flag not-even-close values', function () { - var result = isPhish({ hostname: 'example.com' }) - assert.equal(result, false) - }) - it('should not flag the ropsten faucet domains', function () { - var result = isPhish({ hostname: 'faucet.metamask.io' }) - assert.equal(result, false) - }) - it('should not flag the mascara domain', function () { - var result = isPhish({ hostname: 'zero.metamask.io' }) - assert.equal(result, false) - }) - it('should not flag the mascara-faucet domain', function () { - var result = isPhish({ hostname: 'zero-faucet.metamask.io' }) - assert.equal(result, false) - }) - }) -}) - diff --git a/test/unit/phishing-detection-test.js b/test/unit/phishing-detection-test.js new file mode 100644 index 000000000..affcb16c2 --- /dev/null +++ b/test/unit/phishing-detection-test.js @@ -0,0 +1,36 @@ +const assert = require('assert') +const isPhish = require('../../app/scripts/lib/is-phish') + +describe('phishing detection test', function () { + describe('#isPhish', function () { + it('should not flag whitelisted values', function () { + var result = isPhish({ hostname: 'www.metamask.io' }) + assert.equal(result, false) + }) + it('should flag explicit values', function () { + var result = isPhish({ hostname: 'metamask.com' }) + assert.equal(result, true) + }) + it('should flag levenshtein values', function () { + var result = isPhish({ hostname: 'metmask.io' }) + assert.equal(result, true) + }) + it('should not flag not-even-close values', function () { + var result = isPhish({ hostname: 'example.com' }) + assert.equal(result, false) + }) + it('should not flag the ropsten faucet domains', function () { + var result = isPhish({ hostname: 'faucet.metamask.io' }) + assert.equal(result, false) + }) + it('should not flag the mascara domain', function () { + var result = isPhish({ hostname: 'zero.metamask.io' }) + assert.equal(result, false) + }) + it('should not flag the mascara-faucet domain', function () { + var result = isPhish({ hostname: 'zero-faucet.metamask.io' }) + assert.equal(result, false) + }) + }) +}) + -- cgit v1.2.3