aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-27 07:46:59 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-27 07:46:59 +0800
commit6675241fa9a69d286df2b18a2ad35baa69da116b (patch)
tree25f6fc5361b3d7fc21badeb363ed46fefb92baf4 /test
parent8b1726cc550d4a5b142a2a525ce6b94713dc04e0 (diff)
parente3b5bb2052d59afbf9c2761af883de719261062e (diff)
downloadtangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar.gz
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar.bz2
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar.lz
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar.xz
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.tar.zst
tangerine-wallet-browser-6675241fa9a69d286df2b18a2ad35baa69da116b.zip
Merge branch 'master' into i1805-LiveBlacklistUpdating
Diffstat (limited to 'test')
-rw-r--r--test/unit/blacklister-test.js24
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..1badc2c8f
--- /dev/null
+++ b/test/unit/blacklister-test.js
@@ -0,0 +1,24 @@
+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(!result)
+ })
+ it('should flag explicit values', function () {
+ var result = isPhish({ hostname: 'metamask.com' })
+ assert(result)
+ })
+ it('should flag levenshtein values', function () {
+ var result = isPhish({ hostname: 'metmask.com' })
+ assert(result)
+ })
+ it('should not flag not-even-close values', function () {
+ var result = isPhish({ hostname: 'example.com' })
+ assert(!result)
+ })
+ })
+})
+