Commit 50d0f272 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/293891/fixSuggestionsToReplies' into 'master'

Fixes diff suggestions not working when replying to comments

See merge request gitlab-org/gitlab!52100
parents 00884cb6 fe2b07a7
......@@ -110,11 +110,6 @@ export default {
return this.referencedUsers.length >= referencedUsersThreshold;
},
lineContent() {
const [firstSuggestion] = this.suggestions;
if (firstSuggestion) {
return firstSuggestion.from_content;
}
if (this.line) {
const { rich_text: richText, text } = this.line;
......
---
title: Fixed sdiff suggestions not working when replying to comments
merge_request: 52100
author:
type: fixed
......@@ -73,6 +73,23 @@ RSpec.describe 'User comments on a diff', :js do
end
end
it 'allows suggestions in replies' do
click_diff_line(find("[id='#{sample_compare.changes[1][:line_code]}']"))
page.within('.js-discussion-note-form') do
fill_in('note_note', with: "```suggestion\n# change to a comment\n```")
click_button('Add comment now')
end
wait_for_requests
click_button 'Reply...'
find('.js-suggestion-btn').click
expect(find('.js-vue-issue-note-form').value).to include("url = https://github.com/gitlabhq/gitlab-shell.git")
end
it 'suggestion is appliable' do
click_diff_line(find("[id='#{sample_compare.changes[1][:line_code]}']"))
......
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