Commit 2c3c3a7a authored by Justin Boyson's avatar Justin Boyson Committed by Phil Hughes

Don't show MLC form on thread replies

parent 40caa9d0
...@@ -147,10 +147,10 @@ export default { ...@@ -147,10 +147,10 @@ export default {
return getEndLineNumber(this.lineRange); return getEndLineNumber(this.lineRange);
}, },
showMultiLineComment() { showMultiLineComment() {
if (!this.glFeatures.multilineComments) return false; if (!this.glFeatures.multilineComments || !this.discussionRoot) return false;
if (this.isEditing) return true; if (this.isEditing) return true;
return this.line && this.discussionRoot && this.startLineNumber !== this.endLineNumber; return this.line && this.startLineNumber !== this.endLineNumber;
}, },
commentLineOptions() { commentLineOptions() {
if (!this.diffFile || !this.line) return []; if (!this.diffFile || !this.line) return [];
......
---
title: Fix showing MLC form on replies
merge_request: 37139
author:
type: fixed
...@@ -34,7 +34,13 @@ describe('issue_note', () => { ...@@ -34,7 +34,13 @@ describe('issue_note', () => {
note, note,
}, },
localVue, localVue,
stubs: ['note-header', 'user-avatar-link', 'note-actions', 'note-body'], stubs: [
'note-header',
'user-avatar-link',
'note-actions',
'note-body',
'multiline-comment-form',
],
}); });
}); });
...@@ -77,6 +83,24 @@ describe('issue_note', () => { ...@@ -77,6 +83,24 @@ describe('issue_note', () => {
}); });
}); });
it('should render multiline comment if editing discussion root', () => {
wrapper.setProps({ discussionRoot: true });
wrapper.vm.isEditing = true;
return wrapper.vm.$nextTick().then(() => {
expect(findMultilineComment().exists()).toBe(true);
});
});
it('should not render multiline comment form unless it is the discussion root', () => {
wrapper.setProps({ discussionRoot: false });
wrapper.vm.isEditing = true;
return wrapper.vm.$nextTick().then(() => {
expect(findMultilineComment().exists()).toBe(false);
});
});
it('should not render if has single line comment', () => { it('should not render if has single line comment', () => {
const position = { const position = {
line_range: { line_range: {
......
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