summaryrefslogtreecommitdiff
path: root/spec/features/merge_request
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-05-06 12:56:48 -0500
committerPaul Slaughter <pslaughter@gitlab.com>2019-05-07 00:00:40 -0500
commitd24d77a93a64e4698163c5ca579954f61ad9248a (patch)
tree36f10fd7ad3fd1949e473cbe485cc8971b0d8e45 /spec/features/merge_request
parentdfe59c75bf4d6f6937767ee9ef35df4ef42e7667 (diff)
downloadgitlab-ce-d24d77a93a64e4698163c5ca579954f61ad9248a.tar.gz
Resolve discussion when suggestion is applied54405-resolve-discussion-when-applying-a-suggested-change
- Adds color and a tooltip to describe this new behavior - Does not resolve if discussion is already resolved - Adds an action `resolveDiscussion` to simplify `toggleResolveNote` - Updates docs https://gitlab.com/gitlab-org/gitlab-ce/issues/54405
Diffstat (limited to 'spec/features/merge_request')
-rw-r--r--spec/features/merge_request/user_suggests_changes_on_diff_spec.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb
index 1b5dd6945e0..04c7f4b6c76 100644
--- a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb
+++ b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb
@@ -121,7 +121,7 @@ describe 'User comments on a diff', :js do
end
context 'multi-line suggestions' do
- it 'suggestion is presented' do
+ before do
click_diff_line(find("[id='#{sample_compare.changes[1][:line_code]}']"))
page.within('.js-discussion-note-form') do
@@ -130,7 +130,9 @@ describe 'User comments on a diff', :js do
end
wait_for_requests
+ end
+ it 'suggestion is presented' do
page.within('.diff-discussions') do
expect(page).to have_button('Apply suggestion')
expect(page).to have_content('Suggested change')
@@ -160,22 +162,24 @@ describe 'User comments on a diff', :js do
end
it 'suggestion is appliable' do
- click_diff_line(find("[id='#{sample_compare.changes[1][:line_code]}']"))
+ page.within('.diff-discussions') do
+ expect(page).not_to have_content('Applied')
- page.within('.js-discussion-note-form') do
- fill_in('note_note', with: "```suggestion:-3+5\n# change to a\n# comment\n# with\n# broken\n# lines\n```")
- click_button('Comment')
- end
+ click_button('Apply suggestion')
+ wait_for_requests
- wait_for_requests
+ expect(page).to have_content('Applied')
+ end
+ end
+ it 'resolves discussion when applied' do
page.within('.diff-discussions') do
- expect(page).not_to have_content('Applied')
+ expect(page).not_to have_content('Unresolve discussion')
click_button('Apply suggestion')
wait_for_requests
- expect(page).to have_content('Applied')
+ expect(page).to have_content('Unresolve discussion')
end
end
end