Added tests for hidden jump to button
This commit is contained in:
parent
d147894b84
commit
03ea267f67
|
@ -17,7 +17,7 @@
|
||||||
return Object.keys(this.discussions).length;
|
return Object.keys(this.discussions).length;
|
||||||
},
|
},
|
||||||
showButton: function () {
|
showButton: function () {
|
||||||
return this.discussionsCount > 1 || !this.discussionId;
|
return this.discussionsCount > 0 && (this.discussionsCount > 1 || !this.discussionId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -71,6 +71,8 @@
|
||||||
CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, user);
|
CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, user);
|
||||||
|
|
||||||
ResolveService.updateUpdatedHtml(this.discussionId, data);
|
ResolveService.updateUpdatedHtml(this.discussionId, data);
|
||||||
|
} else {
|
||||||
|
new Flash('An error occurred when trying to resolve a comment. Please try again.', 'alert');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nextTick(this.updateTooltip);
|
this.$nextTick(this.updateTooltip);
|
||||||
|
|
|
@ -45,12 +45,16 @@
|
||||||
mergeRequestId,
|
mergeRequestId,
|
||||||
discussionId
|
discussionId
|
||||||
}, {}).then((response) => {
|
}, {}).then((response) => {
|
||||||
|
if (response.status === 200) {
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
const user = data ? data.resolved_by : null;
|
const user = data ? data.resolved_by : null;
|
||||||
discussion.resolveAllNotes(user);
|
discussion.resolveAllNotes(user);
|
||||||
discussion.loading = false;
|
discussion.loading = false;
|
||||||
|
|
||||||
this.updateUpdatedHtml(discussionId, data);
|
this.updateUpdatedHtml(discussionId, data);
|
||||||
|
} else {
|
||||||
|
new Flash('An error occurred when trying to resolve a discussion. Please try again.', 'alert');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,11 +70,15 @@
|
||||||
mergeRequestId,
|
mergeRequestId,
|
||||||
discussionId
|
discussionId
|
||||||
}, {}).then((response) => {
|
}, {}).then((response) => {
|
||||||
|
if (response.status === 200) {
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
discussion.unResolveAllNotes();
|
discussion.unResolveAllNotes();
|
||||||
discussion.loading = false;
|
discussion.loading = false;
|
||||||
|
|
||||||
this.updateUpdatedHtml(discussionId, data);
|
this.updateUpdatedHtml(discussionId, data);
|
||||||
|
} else {
|
||||||
|
new Flash('An error occurred when trying to unresolve a discussion. Please try again.', 'alert');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,20 @@ feature 'Diff notes resolve', feature: true, js: true do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'no discussions' do
|
||||||
|
before do
|
||||||
|
project.team << [user, :master]
|
||||||
|
login_as user
|
||||||
|
note.destroy
|
||||||
|
visit_merge_request
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'displays no discussion resolved data' do
|
||||||
|
expect(page).not_to have_content('discussion resolved')
|
||||||
|
expect(page).not_to have_selector('.discussion-next-btn')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'as authorized user' do
|
context 'as authorized user' do
|
||||||
before do
|
before do
|
||||||
project.team << [user, :master]
|
project.team << [user, :master]
|
||||||
|
|
Loading…
Reference in New Issue