2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-12-04 12:51:57 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'User expands diff', :js do
|
2018-12-04 12:51:57 -05:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
2018-12-06 09:39:29 -05:00
|
|
|
let(:merge_request) { create(:merge_request, source_branch: 'expand-collapse-files', source_project: project, target_project: project) }
|
2018-12-04 12:51:57 -05:00
|
|
|
|
|
|
|
before do
|
2020-09-21 11:09:44 -04:00
|
|
|
stub_feature_flags(increased_diff_limits: false)
|
2020-11-02 07:09:03 -05:00
|
|
|
allow(Gitlab::CurrentSettings).to receive(:diff_max_patch_bytes).and_return(100.kilobytes)
|
|
|
|
|
2018-12-04 12:51:57 -05:00
|
|
|
visit(diffs_project_merge_request_path(project, merge_request))
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'allows user to expand diff' do
|
2020-08-28 11:10:21 -04:00
|
|
|
page.within find('[id="19763941ab80e8c09871c0a425f0560d9053bcb3"]') do
|
2020-10-30 11:08:59 -04:00
|
|
|
find('[data-testid="expand-button"]').click
|
2018-12-04 12:51:57 -05:00
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
2020-10-30 11:08:59 -04:00
|
|
|
expect(page).not_to have_content('Expand file')
|
2018-12-04 12:51:57 -05:00
|
|
|
expect(page).to have_selector('.code')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|