Commit 44a8c5c2 authored by Nathan Friend's avatar Nathan Friend

Merge branch...

Merge branch '232530-update-release-pages-vuex-stores-to-handle-group-milestones-assocaited-with-a-release' into 'master'

Resolve "Update Release pages Vuex stores to handle Group milestones assocaited with a release"

Closes #232530

See merge request gitlab-org/gitlab!43062
parents d109366a 77430de2
......@@ -45,6 +45,9 @@ export const updateReleaseNotes = ({ commit }, notes) => commit(types.UPDATE_REL
export const updateReleaseMilestones = ({ commit }, milestones) =>
commit(types.UPDATE_RELEASE_MILESTONES, milestones);
export const updateReleaseGroupMilestones = ({ commit }, groupMilestones) =>
commit(types.UPDATE_RELEASE_GROUP_MILESTONES, groupMilestones);
export const addEmptyAssetLink = ({ commit }) => {
commit(types.ADD_EMPTY_ASSET_LINK);
};
......
......@@ -9,6 +9,7 @@ export const UPDATE_CREATE_FROM = 'UPDATE_CREATE_FROM';
export const UPDATE_RELEASE_TITLE = 'UPDATE_RELEASE_TITLE';
export const UPDATE_RELEASE_NOTES = 'UPDATE_RELEASE_NOTES';
export const UPDATE_RELEASE_MILESTONES = 'UPDATE_RELEASE_MILESTONES';
export const UPDATE_RELEASE_GROUP_MILESTONES = 'UPDATE_RELEASE_GROUP_MILESTONES';
export const REQUEST_SAVE_RELEASE = 'REQUEST_SAVE_RELEASE';
export const RECEIVE_SAVE_RELEASE_SUCCESS = 'RECEIVE_SAVE_RELEASE_SUCCESS';
......
......@@ -13,6 +13,7 @@ export default {
name: '',
description: '',
milestones: [],
groupMilestones: [],
assets: {
links: [],
},
......@@ -51,6 +52,10 @@ export default {
state.release.milestones = milestones;
},
[types.UPDATE_RELEASE_GROUP_MILESTONES](state, groupMilestones) {
state.release.groupMilestones = groupMilestones;
},
[types.REQUEST_SAVE_RELEASE](state) {
state.isUpdatingRelease = true;
},
......
......@@ -207,6 +207,15 @@ describe('Release detail actions', () => {
});
});
describe('updateReleaseGroupMilestones', () => {
it(`commits ${types.UPDATE_RELEASE_GROUP_MILESTONES} with the updated release group milestones`, () => {
const newReleaseGroupMilestones = ['v0.0', 'v0.1'];
return testAction(actions.updateReleaseGroupMilestones, newReleaseGroupMilestones, state, [
{ type: types.UPDATE_RELEASE_GROUP_MILESTONES, payload: newReleaseGroupMilestones },
]);
});
});
describe('addEmptyAssetLink', () => {
it(`commits ${types.ADD_EMPTY_ASSET_LINK}`, () => {
return testAction(actions.addEmptyAssetLink, undefined, state, [
......
......@@ -30,6 +30,7 @@ describe('Release detail mutations', () => {
name: '',
description: '',
milestones: [],
groupMilestones: [],
assets: {
links: [],
},
......@@ -112,6 +113,26 @@ describe('Release detail mutations', () => {
});
});
describe(`${types.UPDATE_RELEASE_MILESTONES}`, () => {
it("updates the release's milestones", () => {
state.release = release;
const newReleaseMilestones = ['v0.0', 'v0.1'];
mutations[types.UPDATE_RELEASE_MILESTONES](state, newReleaseMilestones);
expect(state.release.milestones).toBe(newReleaseMilestones);
});
});
describe(`${types.UPDATE_RELEASE_GROUP_MILESTONES}`, () => {
it("updates the release's group milestones", () => {
state.release = release;
const newReleaseGroupMilestones = ['v0.0', 'v0.1'];
mutations[types.UPDATE_RELEASE_GROUP_MILESTONES](state, newReleaseGroupMilestones);
expect(state.release.groupMilestones).toBe(newReleaseGroupMilestones);
});
});
describe(`${types.REQUEST_SAVE_RELEASE}`, () => {
it('set state.isUpdatingRelease to true', () => {
mutations[types.REQUEST_SAVE_RELEASE](state);
......
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