diff --git a/app/scripts/metamask-controller.actions.test.js b/app/scripts/metamask-controller.actions.test.js index a5cc6dc26..11c5a3775 100644 --- a/app/scripts/metamask-controller.actions.test.js +++ b/app/scripts/metamask-controller.actions.test.js @@ -4,6 +4,7 @@ import proxyquire from 'proxyquire'; import { ApprovalRequestNotFoundError } from '@metamask/approval-controller'; import { PermissionsRequestNotFoundError } from '@metamask/permission-controller'; +import nock from 'nock'; import { ORIGIN_METAMASK } from '../../shared/constants/app'; const Ganache = require('../../test/e2e/ganache'); @@ -59,6 +60,21 @@ describe('MetaMaskController', function () { }); beforeEach(function () { + nock('https://static.metafi.codefi.network') + .persist() + .get('/api/v1/lists/eth_phishing_detect_config.json') + .reply( + 200, + JSON.stringify({ + version: 2, + tolerance: 2, + fuzzylist: [], + whitelist: [], + blacklist: ['127.0.0.1'], + }), + ) + .get('/api/v1/lists/phishfort_hotlist.json') + .reply(200, JSON.stringify(['127.0.0.1'])); metamaskController = new MetaMaskController({ showUserConfirmation: noop, encryptor: { @@ -82,6 +98,7 @@ describe('MetaMaskController', function () { afterEach(function () { sandbox.restore(); + nock.cleanAll(); }); after(async function () { diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index 389739283..daeabcd0e 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -117,6 +117,21 @@ describe('MetaMaskController', function () { .persist() .get(/.*/u) .reply(200, '{"JPY":12415.9}'); + nock('https://static.metafi.codefi.network') + .persist() + .get('/api/v1/lists/eth_phishing_detect_config.json') + .reply( + 200, + JSON.stringify({ + version: 2, + tolerance: 2, + fuzzylist: [], + whitelist: [], + blacklist: ['127.0.0.1'], + }), + ) + .get('/api/v1/lists/phishfort_hotlist.json') + .reply(200, JSON.stringify(['127.0.0.1'])); sandbox.replace(browser, 'runtime', { sendMessage: sandbox.stub().rejects(),