diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-10-21 13:59:53 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-10-21 13:59:53 +0800 |
commit | 9c1b2108f69334884473eb95758e2d1c02c984d6 (patch) | |
tree | 93f5255399307a28cb9380dc23c275b406403929 /test/unit/app | |
parent | 13820b6cc1801a420f39cdfecd7ccb5309dc597b (diff) | |
parent | b0c649a4e3c68293e08e764bbf4d53939df88e2d (diff) | |
download | tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.tar.gz tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.tar.zst tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.zip |
fix merge conflicts
Diffstat (limited to 'test/unit/app')
-rw-r--r-- | test/unit/app/controllers/preferences-controller-test.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js index b5ccf3fb5..7f2804a83 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' @@ -479,5 +484,24 @@ describe('preferences controller', function () { assert.equal(preferencesController.store.getState().seedWords, 'foo bar baz') }) }) + + 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']) + }) + + it('should remove custom RPC url from state', function () { + preferencesController.addToFrequentRpcList('rpc_url') + assert.deepEqual(preferencesController.store.getState().frequentRpcList, ['rpc_url']) + preferencesController.removeFromFrequentRpcList('other_rpc_url') + preferencesController.removeFromFrequentRpcList('http://localhost:8545') + preferencesController.removeFromFrequentRpcList('rpc_url') + assert.deepEqual(preferencesController.store.getState().frequentRpcList, []) + }) + }) }) |