mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Remove unused fromDropdownOpen
state in send
reducer (#7700)
The unused state has been removed along with associated actions and action creators.
This commit is contained in:
parent
d7be3834ea
commit
2e188ce4ef
@ -156,7 +156,6 @@
|
||||
},
|
||||
"identities": {},
|
||||
"send": {
|
||||
"fromDropdownOpen": false,
|
||||
"toDropdownOpen": false,
|
||||
"errors": {},
|
||||
"warnings": {}
|
||||
|
@ -276,7 +276,6 @@
|
||||
},
|
||||
"localeMessages": {},
|
||||
"send": {
|
||||
"fromDropdownOpen": false,
|
||||
"toDropdownOpen": false,
|
||||
"errors": {},
|
||||
"warnings": {}
|
||||
|
@ -175,7 +175,6 @@
|
||||
},
|
||||
"identities": {},
|
||||
"send": {
|
||||
"fromDropdownOpen": false,
|
||||
"toDropdownOpen": false,
|
||||
"errors": {},
|
||||
"warnings": {}
|
||||
|
@ -141,7 +141,6 @@
|
||||
},
|
||||
"identities": {},
|
||||
"send": {
|
||||
"fromDropdownOpen": false,
|
||||
"toDropdownOpen": false,
|
||||
"errors": {},
|
||||
"warnings": {},
|
||||
|
@ -1087,7 +1087,6 @@
|
||||
},
|
||||
"identities": {},
|
||||
"send": {
|
||||
"fromDropdownOpen": false,
|
||||
"toDropdownOpen": false,
|
||||
"errors": {},
|
||||
"warnings": {}
|
||||
|
@ -15,13 +15,10 @@ describe('Send Duck', () => {
|
||||
},
|
||||
}
|
||||
const initState = {
|
||||
fromDropdownOpen: false,
|
||||
toDropdownOpen: false,
|
||||
errors: {},
|
||||
gasButtonGroupShown: true,
|
||||
}
|
||||
const OPEN_FROM_DROPDOWN = 'metamask/send/OPEN_FROM_DROPDOWN'
|
||||
const CLOSE_FROM_DROPDOWN = 'metamask/send/CLOSE_FROM_DROPDOWN'
|
||||
const OPEN_TO_DROPDOWN = 'metamask/send/OPEN_TO_DROPDOWN'
|
||||
const CLOSE_TO_DROPDOWN = 'metamask/send/CLOSE_TO_DROPDOWN'
|
||||
const UPDATE_SEND_ERRORS = 'metamask/send/UPDATE_SEND_ERRORS'
|
||||
@ -47,28 +44,11 @@ describe('Send Duck', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('should set fromDropdownOpen to true when receiving a OPEN_FROM_DROPDOWN action', () => {
|
||||
assert.deepEqual(
|
||||
SendReducer(mockState, {
|
||||
type: OPEN_FROM_DROPDOWN,
|
||||
}),
|
||||
Object.assign({ fromDropdownOpen: true }, mockState.send)
|
||||
)
|
||||
})
|
||||
|
||||
it('should return a new object (and not just modify the existing state object)', () => {
|
||||
assert.deepEqual(SendReducer(mockState), mockState.send)
|
||||
assert.notEqual(SendReducer(mockState), mockState.send)
|
||||
})
|
||||
|
||||
it('should set fromDropdownOpen to false when receiving a CLOSE_FROM_DROPDOWN action', () => {
|
||||
assert.deepEqual(
|
||||
SendReducer(mockState, {
|
||||
type: CLOSE_FROM_DROPDOWN,
|
||||
}),
|
||||
Object.assign({ fromDropdownOpen: false }, mockState.send)
|
||||
)
|
||||
})
|
||||
|
||||
it('should set toDropdownOpen to true when receiving a OPEN_TO_DROPDOWN action', () => {
|
||||
assert.deepEqual(
|
||||
|
@ -1,8 +1,6 @@
|
||||
import extend from 'xtend'
|
||||
|
||||
// Actions
|
||||
const OPEN_FROM_DROPDOWN = 'metamask/send/OPEN_FROM_DROPDOWN'
|
||||
const CLOSE_FROM_DROPDOWN = 'metamask/send/CLOSE_FROM_DROPDOWN'
|
||||
const OPEN_TO_DROPDOWN = 'metamask/send/OPEN_TO_DROPDOWN'
|
||||
const CLOSE_TO_DROPDOWN = 'metamask/send/CLOSE_TO_DROPDOWN'
|
||||
const UPDATE_SEND_ERRORS = 'metamask/send/UPDATE_SEND_ERRORS'
|
||||
@ -12,7 +10,6 @@ const HIDE_GAS_BUTTON_GROUP = 'metamask/send/HIDE_GAS_BUTTON_GROUP'
|
||||
|
||||
// TODO: determine if this approach to initState is consistent with conventional ducks pattern
|
||||
const initState = {
|
||||
fromDropdownOpen: false,
|
||||
toDropdownOpen: false,
|
||||
gasButtonGroupShown: true,
|
||||
errors: {},
|
||||
@ -23,14 +20,6 @@ export default function reducer ({ send: sendState = initState }, action = {}) {
|
||||
const newState = extend({}, sendState)
|
||||
|
||||
switch (action.type) {
|
||||
case OPEN_FROM_DROPDOWN:
|
||||
return extend(newState, {
|
||||
fromDropdownOpen: true,
|
||||
})
|
||||
case CLOSE_FROM_DROPDOWN:
|
||||
return extend(newState, {
|
||||
fromDropdownOpen: false,
|
||||
})
|
||||
case OPEN_TO_DROPDOWN:
|
||||
return extend(newState, {
|
||||
toDropdownOpen: true,
|
||||
|
@ -1,9 +0,0 @@
|
||||
const selectors = {
|
||||
getFromDropdownOpen,
|
||||
}
|
||||
|
||||
module.exports = selectors
|
||||
|
||||
function getFromDropdownOpen (state) {
|
||||
return state.send.fromDropdownOpen
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import assert from 'assert'
|
||||
import {
|
||||
getFromDropdownOpen,
|
||||
} from '../send-from-row.selectors.js'
|
||||
|
||||
describe('send-from-row selectors', () => {
|
||||
|
||||
describe('getFromDropdownOpen()', () => {
|
||||
it('should get send.fromDropdownOpen', () => {
|
||||
const state = {
|
||||
send: {
|
||||
fromDropdownOpen: null,
|
||||
},
|
||||
}
|
||||
|
||||
assert.equal(getFromDropdownOpen(state), null)
|
||||
})
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in New Issue
Block a user