Commit ee79fa62 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '208239-description-diffs-are-not-showing-up-in-mrs' into 'master'

Moved descriptionVersion to a getter

See merge request gitlab-org/gitlab!26108
parents 150f788f 27ef40fe
......@@ -28,6 +28,8 @@ export const getUserData = state => state.userData || {};
export const getUserDataByProp = state => prop => state.userData && state.userData[prop];
export const descriptionVersion = state => state.descriptionVersion;
export const notesById = state =>
state.discussions.reduce((acc, note) => {
note.notes.every(n => Object.assign(acc, { [n.id]: n }));
......
......@@ -54,8 +54,8 @@ export default {
};
},
computed: {
...mapGetters(['targetNoteHash']),
...mapState(['descriptionVersion', 'isLoadingDescriptionVersion']),
...mapGetters(['targetNoteHash', 'descriptionVersion']),
...mapState(['isLoadingDescriptionVersion']),
noteAnchorId() {
return `note_${this.note.id}`;
},
......
......@@ -35,6 +35,7 @@ describe('Getters Notes Store', () => {
notesData: notesDataMock,
userData: userDataMock,
noteableData: noteableDataMock,
descriptionVersion: 'descriptionVersion',
};
});
......@@ -385,4 +386,10 @@ describe('Getters Notes Store', () => {
expect(getters.getDiscussion(state)('1')).toEqual({ id: '1' });
});
});
describe('descriptionVersion', () => {
it('should return `descriptionVersion`', () => {
expect(getters.descriptionVersion(state)).toEqual('descriptionVersion');
});
});
});
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