1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/store/actionConstants.test.js
2023-02-02 16:00:05 -06:00

35 lines
891 B
JavaScript

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,
);
});
});
});