2021-02-04 19:15:23 +01:00
|
|
|
import assert from 'assert';
|
|
|
|
import freeze from 'deep-freeze-strict';
|
|
|
|
import reducers from '../../../ui/app/ducks';
|
|
|
|
import * as actionConstants from '../../../ui/app/store/actionConstants';
|
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',
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
freeze(initialState);
|
2016-05-13 10:13:14 +02:00
|
|
|
|
|
|
|
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',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
freeze(action);
|
2016-05-13 10:13:14 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
const resultingState = reducers(initialState, action);
|
|
|
|
assert.equal(resultingState.metamask.selectedAddress, action.value);
|
|
|
|
});
|
|
|
|
});
|