2020-01-09 04:34:58 +01:00
|
|
|
import assert from 'assert'
|
|
|
|
import freeze from 'deep-freeze-strict'
|
|
|
|
import reducers from '../../../ui/app/ducks'
|
|
|
|
import { actionConstants } from '../../../ui/app/store/actions'
|
2016-04-14 00:28:44 +02:00
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
describe('SHOW_ACCOUNT_DETAIL', function () {
|
|
|
|
it('updates metamask state', function () {
|
2019-12-03 15:52:01 +01:00
|
|
|
const initialState = {
|
2016-05-13 10:13:14 +02:00
|
|
|
metamask: {
|
2017-05-04 23:35:10 +02:00
|
|
|
selectedAddress: 'foo',
|
|
|
|
},
|
2016-05-13 10:13:14 +02:00
|
|
|
}
|
|
|
|
freeze(initialState)
|
|
|
|
|
|
|
|
const action = {
|
2020-01-09 04:34:58 +01:00
|
|
|
type: actionConstants.SHOW_ACCOUNT_DETAIL,
|
2016-05-13 10:13:14 +02:00
|
|
|
value: 'bar',
|
|
|
|
}
|
|
|
|
freeze(action)
|
|
|
|
|
2019-12-03 15:52:01 +01:00
|
|
|
const resultingState = reducers(initialState, action)
|
2017-01-31 00:25:12 +01:00
|
|
|
assert.equal(resultingState.metamask.selectedAddress, action.value)
|
2016-05-13 10:13:14 +02:00
|
|
|
})
|
|
|
|
})
|