aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-05-11 04:43:20 +0800
committerGitHub <noreply@github.com>2019-05-11 04:43:20 +0800
commit08e8fb21dc142ab21184c1125f55b9f3e0ce6412 (patch)
tree258cc03afd6ab8036606c06bc323481175a660de /test
parent0cdce533e2e9368b6aa9b37e85dd1f4cc33395aa (diff)
parent77d3bc252d5c4d223e9de3c6700750d1895bb257 (diff)
downloadtangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.gz
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.bz2
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.lz
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.xz
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.tar.zst
tangerine-wallet-browser-08e8fb21dc142ab21184c1125f55b9f3e0ce6412.zip
Merge pull request #6568 from MetaMask/feature/gaba-phishing-controller
feature: integrate gaba/PhishingController
Diffstat (limited to 'test')
-rw-r--r--test/unit/app/controllers/blacklist-controller-test.js56
-rw-r--r--test/unit/app/controllers/metamask-controller-test.js3
2 files changed, 1 insertions, 58 deletions
diff --git a/test/unit/app/controllers/blacklist-controller-test.js b/test/unit/app/controllers/blacklist-controller-test.js
deleted file mode 100644
index 7a14c02cc..000000000
--- a/test/unit/app/controllers/blacklist-controller-test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-const assert = require('assert')
-const BlacklistController = require('../../../../app/scripts/controllers/blacklist')
-
-describe('blacklist controller', function () {
- let blacklistController
-
- before(() => {
- blacklistController = new BlacklistController()
- })
-
- describe('whitelistDomain', function () {
- it('should add hostname to the runtime whitelist', function () {
- blacklistController.whitelistDomain('foo.com')
- assert.deepEqual(blacklistController.store.getState().whitelist, ['foo.com'])
-
- blacklistController.whitelistDomain('bar.com')
- assert.deepEqual(blacklistController.store.getState().whitelist, ['bar.com', 'foo.com'])
- })
- })
-
- 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)
- })
- it('should not flag whitelisted domain', function () {
- blacklistController.whitelistDomain('metamask.com')
- const result = blacklistController.checkForPhishing('metamask.com')
- assert.equal(result, false)
- })
- })
-})
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js
index 0a1a85d5e..4768b7c64 100644
--- a/test/unit/app/controllers/metamask-controller-test.js
+++ b/test/unit/app/controllers/metamask-controller-test.js
@@ -752,8 +752,7 @@ describe('MetaMaskController', function () {
})
it('sets up phishing stream for untrusted communication ', async () => {
- await metamaskController.blacklistController.updatePhishingList()
- console.log(blacklistJSON.blacklist.includes(phishingUrl))
+ await metamaskController.phishingController.updatePhishingLists()
const { promise, resolve } = deferredPromise()