diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-07-27 07:25:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 07:25:30 +0800 |
commit | e3b5bb2052d59afbf9c2761af883de719261062e (patch) | |
tree | cd68712a2429f9cbd1b78f3cd43744ae581a4cdb /test/unit | |
parent | 520cda0058849778461cf6b9682980068149c120 (diff) | |
parent | aa282b4e3a55d090f27e37cacf850aa5298cfe27 (diff) | |
download | tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar.gz tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar.bz2 tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar.lz tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar.xz tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.tar.zst tangerine-wallet-browser-e3b5bb2052d59afbf9c2761af883de719261062e.zip |
Merge pull request #1837 from MetaMask/i1833-levencheck
Levenshtein Checking Logic Added To Blacklist
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/blacklister-test.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/blacklister-test.js b/test/unit/blacklister-test.js new file mode 100644 index 000000000..d9290795c --- /dev/null +++ b/test/unit/blacklister-test.js @@ -0,0 +1,24 @@ +const assert = require('assert') +const Blacklister = require('../../app/scripts/blacklister') + + +describe('blacklister', function () { + describe('#isPhish', function () { + it('should not flag whitelisted values', function () { + var result = Blacklister('www.metamask.io') + assert(!result) + }) + it('should flag explicit values', function () { + var result = Blacklister('metamask.com') + assert(result) + }) + it('should flag levenshtein values', function () { + var result = Blacklister('metmask.io') + assert(result) + }) + it('should not flag not-even-close values', function () { + var result = Blacklister('example.com') + assert(!result) + }) + }) +}) |