diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-08-02 23:41:29 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-08-02 23:41:29 +0800 |
commit | 25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220 (patch) | |
tree | 8e8f6225578722fb825ec0d98b2ff73b94f543d9 /test/unit | |
parent | ece9200c72cd0b53ee237263933b2b9a24ae5802 (diff) | |
parent | d15e402ed87bf7533250c49a7972a7b1a12c99c2 (diff) | |
download | tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar.gz tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar.bz2 tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar.lz tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar.xz tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.tar.zst tangerine-wallet-browser-25cffd21f8defdf5a1bf139bdc2e3b1cfd08c220.zip |
Merge branch 'master' into transactionControllerRefractor
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/blacklister-test.js | 24 | ||||
-rw-r--r-- | test/unit/nonce-tracker-test.js | 8 |
2 files changed, 29 insertions, 3 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) + }) + }) +}) + diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js index 16cd6d008..b0283e159 100644 --- a/test/unit/nonce-tracker-test.js +++ b/test/unit/nonce-tracker-test.js @@ -18,11 +18,13 @@ describe('Nonce Tracker', function () { getPendingTransactions = () => pendingTxs - provider = { sendAsync: (_, cb) => { cb(undefined, {result: '0x0'}) } } - nonceTracker = new NonceTracker({ - blockTracker: { + provider = { + sendAsync: (_, cb) => { cb(undefined, {result: '0x0'}) }, + _blockTracker: { getCurrentBlock: () => '0x11b568', }, + } + nonceTracker = new NonceTracker({ provider, getPendingTransactions, }) |