aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/preferences-controller-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/app/controllers/preferences-controller-test.js')
-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 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, [])
+ })
+ })
})