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
|
2019-11-26 04:08:36 -05:00
|
|
|
stub_feature_flags(diffs_batch_load: false)
|
2019-11-10 19:06:26 -05:00
|
|
|
|
2018-12-06 09:39:29 -05:00
|
|
|
allow(Gitlab::Git::Diff).to receive(:size_limit).and_return(100.kilobytes)
|
|
|
|
allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.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
|
2019-11-26 04:08:36 -05:00
|
|
|
page.within find('[id="6eb14e00385d2fb284765eb1cd8d420d33d63fc9"]') do
|
2018-12-04 12:51:57 -05:00
|
|
|
click_link 'Click to expand it.'
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
expect(page).not_to have_content('Click to expand it.')
|
|
|
|
expect(page).to have_selector('.code')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|