2017-07-27 00:24:57 +02:00
|
|
|
const assert = require('assert')
|
2017-07-27 01:46:59 +02:00
|
|
|
const isPhish = require('../../app/scripts/lib/is-phish')
|
2017-07-27 00:24:57 +02:00
|
|
|
|
|
|
|
describe('blacklister', function () {
|
|
|
|
describe('#isPhish', function () {
|
|
|
|
it('should not flag whitelisted values', function () {
|
2017-07-27 01:46:59 +02:00
|
|
|
var result = isPhish({ hostname: 'www.metamask.io' })
|
2017-07-27 00:24:57 +02:00
|
|
|
assert(!result)
|
|
|
|
})
|
|
|
|
it('should flag explicit values', function () {
|
2017-07-27 01:46:59 +02:00
|
|
|
var result = isPhish({ hostname: 'metamask.com' })
|
2017-07-27 00:24:57 +02:00
|
|
|
assert(result)
|
|
|
|
})
|
|
|
|
it('should flag levenshtein values', function () {
|
2017-07-27 01:46:59 +02:00
|
|
|
var result = isPhish({ hostname: 'metmask.com' })
|
2017-07-27 00:24:57 +02:00
|
|
|
assert(result)
|
|
|
|
})
|
|
|
|
it('should not flag not-even-close values', function () {
|
2017-07-27 01:46:59 +02:00
|
|
|
var result = isPhish({ hostname: 'example.com' })
|
2017-07-27 00:24:57 +02:00
|
|
|
assert(!result)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
2017-07-27 01:46:59 +02:00
|
|
|
|