1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-26 05:13:37 +02:00
metamask-extension/test/unit/actions/config_test.js
Mark Stacey 8225bbe126
Remove unused current view related things (#7843)
* Remove unused functions from `mapDispatchToProps`

The actions import was also updated to import only the two actions
used, rather than all actions.

* Remove unused container component

Well, technically it was the props injected by this container that were
unused. The container served no purpose, so the component it surrounded
is now used directly instead.

* Remove both unused `getCurrentViewContext` selectors

* Remove unused SHOW_CONFIG_PAGE action

* Remove checks for `currentView` with name `config`

Now that the SHOW_CONFIG_PAGE action has been removed, it's no longer
possible for `currentView.name` to be set to that value.

* Remove unused `wallet-view` container props

* Delete unused SHOW_SEND_PAGE and SHOW_ADD_TOKEN_PAGE actions

* Remove unused `account-menu.container` props

* Remove unused SHOW_INFO_PAGE action

* Remove unused SET_NEW_ACCOUNT_FORM action
2020-01-16 13:02:44 -04:00

33 lines
860 B
JavaScript

import assert from 'assert'
import freeze from 'deep-freeze-strict'
import reducers from '../../../ui/app/ducks'
import * as actions from '../../../ui/app/store/actions'
describe('config view actions', function () {
const initialState = {
metamask: {
rpcTarget: 'foo',
frequentRpcList: [],
},
appState: {
currentView: {
name: 'accounts',
},
},
}
freeze(initialState)
describe('SET_RPC_TARGET', function () {
it('sets the state.metamask.rpcTarget property of the state to the action.value', function () {
const action = {
type: actions.actionConstants.SET_RPC_TARGET,
value: 'foo',
}
const result = reducers(initialState, action)
assert.equal(result.metamask.provider.type, 'rpc')
assert.equal(result.metamask.provider.rpcTarget, 'foo')
})
})
})