Commit fe2b07a7 authored by Phil Hughes's avatar Phil Hughes Committed by Kushal Pandya

Fixes diff suggestions not working when replying to comments

https://gitlab.com/gitlab-org/gitlab/-/issues/293891
parent dd2c85e3
......@@ -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