Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/features/merge_request/user_comments_on_diff_spec.rb
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/features/merge_request/user_comments_on_diff_spec.rb')
-rw-r--r--spec/features/merge_request/user_comments_on_diff_spec.rb46
1 files changed, 40 insertions, 6 deletions
diff --git a/spec/features/merge_request/user_comments_on_diff_spec.rb b/spec/features/merge_request/user_comments_on_diff_spec.rb
index 19b8a7f74b7..9cd3c7eaf76 100644
--- a/spec/features/merge_request/user_comments_on_diff_spec.rb
+++ b/spec/features/merge_request/user_comments_on_diff_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'User comments on a diff', :js do
+RSpec.describe 'User comments on a diff', :js do
include MergeRequestDiffHelpers
include RepoHelpers
@@ -27,7 +27,7 @@ describe 'User comments on a diff', :js do
page.within('.js-discussion-note-form') do
fill_in('note_note', with: 'Line is wrong')
- click_button('Comment')
+ click_button('Add comment now')
end
page.within('.diff-files-holder > div:nth-child(3)') do
@@ -46,7 +46,7 @@ describe 'User comments on a diff', :js do
page.within('.js-discussion-note-form') do
fill_in('note_note', with: 'Line is correct')
- click_button('Comment')
+ click_button('Add comment now')
end
wait_for_requests
@@ -59,7 +59,7 @@ describe 'User comments on a diff', :js do
page.within('.js-discussion-note-form') do
fill_in('note_note', with: 'Line is wrong')
- click_button('Comment')
+ click_button('Add comment now')
end
wait_for_requests
@@ -114,13 +114,47 @@ describe 'User comments on a diff', :js do
include_examples 'comment on merge request file'
end
+ context 'when adding multiline comments' do
+ it 'saves a multiline comment' do
+ click_diff_line(find("[id='#{sample_commit.line_code}']"))
+
+ page.within('.discussion-form') do
+ find('#comment-line-start option', text: '-13').select_option
+ end
+
+ page.within('.js-discussion-note-form') do
+ fill_in(:note_note, with: 'Line is wrong')
+ click_button('Add comment now')
+ end
+
+ wait_for_requests
+
+ page.within('.notes_holder') do
+ expect(page).to have_content('Line is wrong')
+ expect(page).to have_content('Comment on lines -13 to +14')
+ end
+
+ visit(merge_request_path(merge_request))
+
+ page.within('.notes .discussion') do
+ expect(page).to have_content("#{user.name} #{user.to_reference} started a thread")
+ expect(page).to have_content(sample_commit.line_code_path)
+ expect(page).to have_content('Line is wrong')
+ end
+
+ page.within('.notes-tab .badge') do
+ expect(page).to have_content('1')
+ end
+ end
+ end
+
context 'when editing comments' do
it 'edits a comment' do
click_diff_line(find("[id='#{sample_commit.line_code}']"))
page.within('.js-discussion-note-form') do
fill_in(:note_note, with: 'Line is wrong')
- click_button('Comment')
+ click_button('Add comment now')
end
page.within('.diff-file:nth-of-type(5) .discussion .note') do
@@ -146,7 +180,7 @@ describe 'User comments on a diff', :js do
page.within('.js-discussion-note-form') do
fill_in(:note_note, with: 'Line is wrong')
- click_button('Comment')
+ click_button('Add comment now')
end
page.within('.notes-tab .badge') do