aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/preferences-controller-test.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-10-30 07:49:53 +0800
committerGitHub <noreply@github.com>2018-10-30 07:49:53 +0800
commitad009a4606249649fd54420972fb6a5dd5382fc2 (patch)
tree45f50fb1eca1ad7cb3773446a01ad4867283f365 /test/unit/app/controllers/preferences-controller-test.js
parentf0602ca354a6d352c13a79a1cba884f54e5b9a83 (diff)
parent18e530221b0f960907d45995c4703b04ed562dc8 (diff)
downloadtangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.gz
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.zst
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.zip
Merge branch 'develop' into sentry-enhancements2
Diffstat (limited to 'test/unit/app/controllers/preferences-controller-test.js')
-rw-r--r--test/unit/app/controllers/preferences-controller-test.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js
index 02f421de2..c64c47ae9 100644
--- a/test/unit/app/controllers/preferences-controller-test.js
+++ b/test/unit/app/controllers/preferences-controller-test.js
@@ -375,6 +375,11 @@ describe('preferences controller', function () {
await preferencesController.requestWatchAsset(req, res, asy.next, asy.end)
sandbox.assert.called(stubEnd)
sandbox.assert.notCalled(stubNext)
+ req.method = 'wallet_watchAsset'
+ req.params.type = 'someasset'
+ await preferencesController.requestWatchAsset(req, res, asy.next, asy.end)
+ sandbox.assert.calledTwice(stubEnd)
+ sandbox.assert.notCalled(stubNext)
})
it('should through error if method is supported but asset type is not', async function () {
req.method = 'metamask_watchAsset'
@@ -482,20 +487,20 @@ describe('preferences controller', function () {
describe('on updateFrequentRpcList', function () {
it('should add custom RPC url to state', function () {
- preferencesController.addToFrequentRpcList('rpc_url')
- preferencesController.addToFrequentRpcList('http://localhost:8545')
- assert.deepEqual(preferencesController.store.getState().frequentRpcList, ['rpc_url'])
- preferencesController.addToFrequentRpcList('rpc_url')
- assert.deepEqual(preferencesController.store.getState().frequentRpcList, ['rpc_url'])
+ preferencesController.addToFrequentRpcList('rpc_url', 1)
+ preferencesController.addToFrequentRpcList('http://localhost:8545', 1)
+ assert.deepEqual(preferencesController.store.getState().frequentRpcListDetail, [{ rpcUrl: 'rpc_url', chainId: 1, ticker: 'ETH', nickname: '' }] )
+ preferencesController.addToFrequentRpcList('rpc_url', 1)
+ assert.deepEqual(preferencesController.store.getState().frequentRpcListDetail, [{ rpcUrl: 'rpc_url', chainId: 1, ticker: 'ETH', nickname: '' }] )
})
it('should remove custom RPC url from state', function () {
- preferencesController.addToFrequentRpcList('rpc_url')
- assert.deepEqual(preferencesController.store.getState().frequentRpcList, ['rpc_url'])
+ preferencesController.addToFrequentRpcList('rpc_url', 1)
+ assert.deepEqual(preferencesController.store.getState().frequentRpcListDetail, [{ rpcUrl: 'rpc_url', chainId: 1, ticker: 'ETH', nickname: '' }] )
preferencesController.removeFromFrequentRpcList('other_rpc_url')
preferencesController.removeFromFrequentRpcList('http://localhost:8545')
preferencesController.removeFromFrequentRpcList('rpc_url')
- assert.deepEqual(preferencesController.store.getState().frequentRpcList, [])
+ assert.deepEqual(preferencesController.store.getState().frequentRpcListDetail, [])
})
})
})