diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 21:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 21:08:51 +0300 |
commit | df2eda3f14dccb703bd7054d4ddde7803cb1fe7e (patch) | |
tree | 0200bb0def01cde22da3bc4c9ed0a7b0f91d6b50 /spec/features | |
parent | b9bac6dbf78a5a7976fba14aaeef96bdeb0da612 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/merge_request/user_views_diffs_spec.rb | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb index e0e4058dd47..cd0cf1cc78a 100644 --- a/spec/features/merge_request/user_views_diffs_spec.rb +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -7,10 +7,11 @@ describe 'User views diffs', :js do create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') end let(:project) { create(:project, :public, :repository) } + let(:view) { 'inline' } before do stub_feature_flags(diffs_batch_load: false) - visit(diffs_project_merge_request_path(project, merge_request)) + visit(diffs_project_merge_request_path(project, merge_request, view: view)) wait_for_requests @@ -20,12 +21,20 @@ describe 'User views diffs', :js do shared_examples 'unfold diffs' do it 'unfolds diffs upwards' do first('.js-unfold').click - expect(find('.file-holder[id="a5cc2925ca8258af241be7e5b0381edf30266302"] .text-file')).to have_content('.bundle') + + page.within('.file-holder[id="a5cc2925ca8258af241be7e5b0381edf30266302"]') do + expect(find('.text-file')).to have_content('.bundle') + expect(page).to have_selector('.new_line [data-linenumber="1"]', count: 1) + end end - it 'unfolds diffs to the start' do - first('.js-unfold-all').click - expect(find('.file-holder[id="a5cc2925ca8258af241be7e5b0381edf30266302"] .text-file')).to have_content('.rbc') + it 'unfolds diffs in the middle' do + page.within('.file-holder[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd"]') do + all('.js-unfold-all')[1].click + + expect(page).to have_selector('.new_line [data-linenumber="24"]', count: 1) + expect(page).not_to have_selector('.new_line [data-linenumber="1"]') + end end it 'unfolds diffs downwards' do @@ -66,13 +75,7 @@ describe 'User views diffs', :js do end context 'when in the side-by-side view' do - before do - find('.js-show-diff-settings').click - - click_button 'Side-by-side' - - wait_for_requests - end + let(:view) { 'parallel' } it 'shows diffs in parallel' do expect(page).to have_css('.parallel') |