Skip to content
Snippets Groups Projects

Users can apply multiple suggestions at once.

Merged Jesse Hall requested to merge jessehall3/gitlab-ee:25486-batch-suggestions into master
1 file
+ 71
0
Compare changes
  • Side-by-side
  • Inline
@@ -91,6 +91,77 @@ def expect_appliable_suggestions(amount)
expect(page).to have_content('Applied')
end
end
it 'can add mutltiple suggestions to a batch' do #TODO: Get help with this test.
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('Comment')
end
wait_for_requests
page.within('.diff-discussions') do
expect(page).not_to have_content('Applied')
click_button('Add suggestion to batch')
wait_for_requests
expect(page).to have_content('Remove from batch')
expect(page).to have_content('Apply suggestions 1')
end
end
it 'can remove suggestions from a batch' do #TODO: Get help with this test.
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('Comment')
end
wait_for_requests
page.within('.diff-discussions') do
click_button('Add suggestion to batch')
wait_for_requests
expect(page).to have_content('Remove from batch')
expect(page).to have_content('Apply suggestions 1')
click_button('Remove from batch')
wait_for_requests
expect(page).to have_content('Apply suggestion')
expect(page).to have_content('Add suggestion to batch')
end
end
it 'apply suggestions as a batch' do #TODO: Get help with this test.
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('Comment')
end
wait_for_requests
page.within('.diff-discussions') do
click_button('Add suggestion to batch')
wait_for_requests
click_button('Apply suggestions 1')
wait_for_requests
expect(page).to have_content('Applied')
end
end
end
context 'multiple suggestions in expanded lines' do
Loading