diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-07 10:55:34 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-07 10:55:34 +0800 |
commit | 02c2106c3bb6900801cf5ffe4a1d9bd46183b089 (patch) | |
tree | 23f6d76a57c7b58a385ee49e8a24e402ed474775 /test/unit/blacklist-controller-test.js | |
parent | fd36d95c506db55afa33a251c6c187c194a55854 (diff) | |
parent | 2ba5737728d2539fc3bc9015e440f37341219cdc (diff) | |
download | dexon-wallet-02c2106c3bb6900801cf5ffe4a1d9bd46183b089.tar.gz dexon-wallet-02c2106c3bb6900801cf5ffe4a1d9bd46183b089.tar.zst dexon-wallet-02c2106c3bb6900801cf5ffe4a1d9bd46183b089.zip |
Merge branch 'master' into feat/mm-ui-5
Diffstat (limited to 'test/unit/blacklist-controller-test.js')
-rw-r--r-- | test/unit/blacklist-controller-test.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/unit/blacklist-controller-test.js b/test/unit/blacklist-controller-test.js new file mode 100644 index 00000000..a9260466 --- /dev/null +++ b/test/unit/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) + }) + }) +})
\ No newline at end of file |