diff options
author | Samantha Ming <sming@gitlab.com> | 2019-08-10 02:36:32 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-08-10 02:36:32 +0000 |
commit | fc0ff7cf033e6267d7348057faee0fbedf5b90e8 (patch) | |
tree | 49dc31b7ff02ccd3cb37191fae100e7bbf661c54 /spec/features/merge_request | |
parent | cdac9ed86fb2c3a373be5b923bc3f02387b528fc (diff) | |
download | gitlab-ce-fc0ff7cf033e6267d7348057faee0fbedf5b90e8.tar.gz |
Replace ... with new expansion options
- expand upwards
- expand downwards
- expand all
in both inline and parallel views
Diffstat (limited to 'spec/features/merge_request')
-rw-r--r-- | spec/features/merge_request/user_posts_diff_notes_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/merge_request/user_views_diffs_spec.rb | 18 |
2 files changed, 24 insertions, 6 deletions
diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb index ead564aea28..abae6ffbd71 100644 --- a/spec/features/merge_request/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb @@ -68,12 +68,12 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting on the left side' do line_holder = find('.match', match: :first).find(:xpath, '..') - should_not_allow_commenting(line_holder, 'left') + match_should_not_allow_commenting(line_holder) end it 'does not allow commenting on the right side' do line_holder = find('.match', match: :first).find(:xpath, '..') - should_not_allow_commenting(line_holder, 'right') + match_should_not_allow_commenting(line_holder) end end @@ -136,7 +136,7 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting' do - should_not_allow_commenting(find('.match', match: :first)) + match_should_not_allow_commenting(find('.match', match: :first)) end end @@ -222,7 +222,7 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting' do - should_not_allow_commenting(find('.match', match: :first)) + match_should_not_allow_commenting(find('.match', match: :first)) end end end @@ -251,6 +251,10 @@ describe 'Merge request > User posts diff notes', :js do expect(line[:num]).not_to have_css comment_button_class end + def match_should_not_allow_commenting(line_holder) + expect(line_holder).not_to have_css comment_button_class + end + def write_comment_on_line(line_holder, diff_side) click_diff_line(line_holder, diff_side) diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb index 6d58d43a295..2d1eb260236 100644 --- a/spec/features/merge_request/user_views_diffs_spec.rb +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -17,11 +17,25 @@ describe 'User views diffs', :js do end shared_examples 'unfold diffs' do - it 'unfolds diffs' do + it 'unfolds diffs upwards' do first('.js-unfold').click - expect(find('.file-holder[id="a5cc2925ca8258af241be7e5b0381edf30266302"] .text-file')).to have_content('.bundle') 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') + end + + it 'unfolds diffs downwards' do + first('.js-unfold-down').click + expect(find('.file-holder[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd"] .text-file')).to have_content('.popen3') + end + + it 'unfolds diffs to the end' do + page.all('.js-unfold-down').last + expect(find('.file-holder[id="6eb14e00385d2fb284765eb1cd8d420d33d63fc9"] .text-file')).to have_content('end') + end end it 'shows diffs' do |