diff options
author | Esteban MiƱo <efmino@uc.cl> | 2018-10-20 04:20:54 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-20 04:20:54 +0800 |
commit | 7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22 (patch) | |
tree | f92fceda6f27e60dac99ad3efb094f381dcec7fc /test | |
parent | ea214945cf88cef457147bd33a3017c8ea97956a (diff) | |
download | tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar.gz tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar.bz2 tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar.lz tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar.xz tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.tar.zst tangerine-wallet-browser-7c4f98ffd6f5d7237d86cb7e1277ec44dec2db22.zip |
specific add and remove methods for frequentRpcList (#5554)
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/app/controllers/preferences-controller-test.js | 19 |
1 files changed, 19 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..02f421de2 100644 --- a/test/unit/app/controllers/preferences-controller-test.js +++ b/test/unit/app/controllers/preferences-controller-test.js @@ -479,5 +479,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, []) + }) + }) }) |