aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-08 02:37:01 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-08 02:37:01 +0800
commit01f2ec4823e83d986e7ecfd268f6b293f38a13e8 (patch)
tree799d29833141db4846790e0dbb028db2c9701ff6 /test/unit
parent2a98beb87877619ad123281facab3e22dec64fab (diff)
downloadtangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar.gz
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar.bz2
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar.lz
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar.xz
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.tar.zst
tangerine-wallet-browser-01f2ec4823e83d986e7ecfd268f6b293f38a13e8.zip
Modify tests.'
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/actions/config_test.js34
1 files changed, 19 insertions, 15 deletions
diff --git a/test/unit/actions/config_test.js b/test/unit/actions/config_test.js
index fea0cf0ba..eca2f7c8f 100644
--- a/test/unit/actions/config_test.js
+++ b/test/unit/actions/config_test.js
@@ -31,35 +31,39 @@ describe ('config view actions', function() {
describe('SET_RPC_TARGET', function() {
it('sets the state.metamask.rpcTarget property of the state to the action.value', function() {
- const value = {
- rpcTarget: 'foo',
- frequentRpcList: ['foo']
- }
const action = {
type: actions.SET_RPC_TARGET,
- value,
+ value: 'foo',
+ }
+
+ const secondAction = {
+ type: actions.SET_RPC_LIST,
+ value: ['foo'],
}
var result = reducers(initialState, action)
+ result = reducers(result, secondAction)
assert.equal(result.metamask.provider.type, 'rpc')
- assert.equal(result.metamask.provider.rpcTarget, value.rpcTarget)
- assert.equal(result.metamask.frequentRpcList[0], value.frequentRpcList[0])
+ assert.equal(result.metamask.provider.rpcTarget, 'foo')
+ assert.equal(result.metamask.frequentRpcList[0], 'foo')
})
it('should handle multiple requests to change the rpc gracefully', function() {
- const value = {
- rpcTarget: 'foo',
- frequentRpcList: ['foo']
- }
-
const action = {
type: actions.SET_RPC_TARGET,
- value,
+ value: 'foo',
+ }
+
+ const secondAction = {
+ type: actions.SET_RPC_LIST,
+ value: ['foo'],
}
var result = reducers(initialState, action)
- var secondResult = reducers(result, action)
- assert.equal(secondResult.metamask.frequentRpcList.length, 1)
+ var secondResult = reducers(result, secondAction)
+ var thirdResult = reducers(secondResult, action)
+ var fourthResult = reducers(thirdResult, secondAction)
+ assert.equal(fourthResult.metamask.frequentRpcList.length, 1)
})
})