2020-06-01 02:08:21 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Merge request > image review', :js do
|
2020-06-01 02:08:21 -04:00
|
|
|
include MergeRequestDiffHelpers
|
|
|
|
include RepoHelpers
|
|
|
|
|
2022-01-24 19:11:49 -05:00
|
|
|
let(:user) { project.first_owner }
|
2020-06-01 02:08:21 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:merge_request) { create(:merge_request_with_diffs, :with_image_diffs, source_project: project, author: user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
allow_any_instance_of(DiffHelper).to receive(:diff_file_blob_raw_url).and_return('/apple-touch-icon.png')
|
|
|
|
allow_any_instance_of(DiffHelper).to receive(:diff_file_old_blob_raw_url).and_return('/favicon.png')
|
|
|
|
|
|
|
|
visit diffs_project_merge_request_path(merge_request.project, merge_request)
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'leaves review' do
|
|
|
|
find('.js-add-image-diff-note-button', match: :first).click
|
|
|
|
|
|
|
|
find('.diff-content .note-textarea').native.send_keys('image diff test comment')
|
|
|
|
|
|
|
|
click_button('Start a review')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.within(find('.draft-note-component')) do
|
|
|
|
expect(page).to have_content('image diff test comment')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|