1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00
metamask-extension/ui/store/actionConstants.test.js

35 lines
891 B
JavaScript
Raw Permalink Normal View History

import freeze from 'deep-freeze-strict';
import reducers from '../ducks';
import * as actionConstants from './actionConstants';
describe('Redux actionConstants', () => {
describe('SET_ACCOUNT_LABEL', () => {
it('updates the state.metamask.identities[:i].name property of the state to the action.value.label', () => {
const initialState = {
metamask: {
identities: {
foo: {
name: 'bar',
},
},
},
};
freeze(initialState);
const action = {
type: actionConstants.SET_ACCOUNT_LABEL,
value: {
account: 'foo',
label: 'baz',
},
};
freeze(action);
const resultingState = reducers(initialState, action);
expect(resultingState.metamask.identities.foo.name).toStrictEqual(
action.value.label,
);
});
});
});