Commit 0a947a09 authored by Phil Hughes's avatar Phil Hughes

Fix resolve discussion checkbox showing on issues

parent b7c0076e
...@@ -199,7 +199,7 @@ export default { ...@@ -199,7 +199,7 @@ export default {
></textarea> ></textarea>
</markdown-field> </markdown-field>
<div class="note-form-actions clearfix"> <div class="note-form-actions clearfix">
<p v-if="(discussion && discussion.id) || isDraft"> <p v-if="showResolveDiscussionToggle">
<label> <label>
<template v-if="discussionResolved"> <template v-if="discussionResolved">
<input <input
......
...@@ -16,6 +16,12 @@ export default { ...@@ -16,6 +16,12 @@ export default {
showBatchCommentsActions() { showBatchCommentsActions() {
return this.withBatchComments && this.noteId === '' && !this.discussion.for_commit; return this.withBatchComments && this.noteId === '' && !this.discussion.for_commit;
}, },
showResolveDiscussionToggle() {
return (
((this.discussion && this.discussion.id && this.discussion.resolvable) || this.isDraft) &&
this.withBatchComments
);
},
}, },
methods: { methods: {
shouldBeResolved(resolveStatus) { shouldBeResolved(resolveStatus) {
......
...@@ -31,6 +31,12 @@ describe('issue_note_form component', () => { ...@@ -31,6 +31,12 @@ describe('issue_note_form component', () => {
vm.$destroy(); vm.$destroy();
}); });
describe('without batch comments', () => {
it('does not show resolve checkbox', () => {
expect(vm.$el.querySelector('.qa-resolve-review-discussion')).toBe(null);
});
});
describe('with batch comments', () => { describe('with batch comments', () => {
beforeEach(done => { beforeEach(done => {
store store
...@@ -40,6 +46,10 @@ describe('issue_note_form component', () => { ...@@ -40,6 +46,10 @@ describe('issue_note_form component', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('shows resolve checkbox', () => {
expect(vm.$el.querySelector('.qa-resolve-review-discussion')).not.toBe(null);
});
it('hides actions for commits', done => { it('hides actions for commits', done => {
vm.discussion.for_commit = true; vm.discussion.for_commit = true;
......
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