Commit 9a326fa7 authored by Thomas Randolph's avatar Thomas Randolph

Add a mutator action to set the MR Metadata

parent 17c3dcf6
......@@ -7,3 +7,7 @@ export function setActiveTab({ commit }, tab) {
export function setEndpoints({ commit }, endpoints) {
commit(types.SET_ENDPOINTS, endpoints);
}
export function setMrMetadata({ commit }, metadata) {
commit(types.SET_MR_METADATA, metadata);
}
import testAction from 'helpers/vuex_action_helper';
import { setEndpoints } from '~/mr_notes/stores/actions';
import { setEndpoints, setMrMetadata } from '~/mr_notes/stores/actions';
import mutationTypes from '~/mr_notes/stores/mutation_types';
describe('MR Notes Mutator Actions', () => {
......@@ -22,4 +22,24 @@ describe('MR Notes Mutator Actions', () => {
);
});
});
describe('setMrMetadata', () => {
it('should trigger the SET_MR_METADATA state mutation', (done) => {
const mrMetadata = { propA: 'a', propB: 'b' };
testAction(
setMrMetadata,
mrMetadata,
{},
[
{
type: mutationTypes.SET_MR_METADATA,
payload: mrMetadata,
},
],
[],
done,
);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment