aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/app/controllers/preferences-controller-test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js
index 67d1875c1..558597ae7 100644
--- a/test/unit/app/controllers/preferences-controller-test.js
+++ b/test/unit/app/controllers/preferences-controller-test.js
@@ -511,6 +511,18 @@ describe('preferences controller', function () {
})
})
+ describe('#updateRpc', function () {
+ it('should update the rpcDetails properly', () => {
+ preferencesController.store.updateState({frequentRpcListDetail: [{}, { rpcUrl: 'test' }, {}]})
+ preferencesController.updateRpc({ rpcUrl: 'test', chainId: 1 })
+ preferencesController.updateRpc({ rpcUrl: 'test/1', chainId: 1 })
+ preferencesController.updateRpc({ rpcUrl: 'test/2', chainId: 1 })
+ preferencesController.updateRpc({ rpcUrl: 'test/3', chainId: 1 })
+ const list = preferencesController.getFrequentRpcListDetail()
+ assert.deepEqual(list[1], { rpcUrl: 'test', chainId: 1 })
+ })
+ })
+
describe('on updateFrequentRpcList', function () {
it('should add custom RPC url to state', function () {
preferencesController.addToFrequentRpcList('rpc_url', 1)