Fixed karma spec for getNoteFormData

Fixed toggling new notes caused by not returning the stores discussion
This commit is contained in:
Phil Hughes 2018-09-17 09:49:52 +01:00 committed by André Luís
parent 2497c29ef0
commit e3cc9d53d2
3 changed files with 3 additions and 5 deletions

View File

@ -44,10 +44,10 @@ export const fetchDiscussions = ({ commit }, path) =>
commit(types.SET_INITIAL_DISCUSSIONS, discussions);
});
export const updateDiscussion = ({ commit }, discussion) => {
export const updateDiscussion = ({ commit, state }, discussion) => {
commit(types.UPDATE_DISCUSSION, discussion);
return discussion;
return utils.findNoteObjectById(state.discussions, discussion.id);
};
export const deleteNote = ({ commit, dispatch }, note) =>

View File

@ -3687,9 +3687,6 @@ msgstr ""
msgid "MergeRequests|Toggle comments for this file"
msgstr ""
msgid "MergeRequests|Updating discussions failed"
msgstr ""
msgid "MergeRequests|View file @ %{commitId}"
msgstr ""

View File

@ -136,6 +136,7 @@ describe('DiffsStoreUtils', () => {
note_project_id: '',
target_type: options.noteableType,
target_id: options.noteableData.id,
return_discussion: 'true',
note: {
noteable_type: options.noteableType,
noteable_id: options.noteableData.id,