aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/app/controllers/preferences-controller-test.js19
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 e81b072d5..7f2804a83 100644
--- a/test/unit/app/controllers/preferences-controller-test.js
+++ b/test/unit/app/controllers/preferences-controller-test.js
@@ -484,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, [])
+ })
+ })
})