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