diff options
Diffstat (limited to 'spec/support/shared_examples/features/content_editor_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/content_editor_shared_examples.rb | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/spec/support/shared_examples/features/content_editor_shared_examples.rb b/spec/support/shared_examples/features/content_editor_shared_examples.rb index f70288168d7..254bc3c83ac 100644 --- a/spec/support/shared_examples/features/content_editor_shared_examples.rb +++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb @@ -506,6 +506,8 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi switch_to_content_editor type_in_content_editor :enter + + stub_feature_flags(disable_all_mention: false) end if params[:with_expanded_references] @@ -545,12 +547,32 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi expect(page).to have_text('@abc123') end + context 'when `disable_all_mention` is enabled' do + before do + stub_feature_flags(disable_all_mention: true) + end + + it 'shows suggestions for members with descriptions' do + type_in_content_editor '@a' + + expect(find(suggestions_dropdown)).to have_text('abc123') + expect(find(suggestions_dropdown)).not_to have_text('All Group Members') + + type_in_content_editor 'bc' + + send_keys [:arrow_down, :enter] + + expect(page).not_to have_css(suggestions_dropdown) + expect(page).to have_text('@abc123') + end + end + it 'shows suggestions for merge requests' do type_in_content_editor '!' expect(find(suggestions_dropdown)).to have_text('My Cool Merge Request') - send_keys :enter + send_keys [:arrow_down, :enter] expect(page).not_to have_css(suggestions_dropdown) expect(page).to have_text('!1') @@ -561,7 +583,7 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi expect(find(suggestions_dropdown)).to have_text('My Cool Linked Issue') - send_keys :enter + send_keys [:arrow_down, :enter] expect(page).not_to have_css(suggestions_dropdown) expect(page).to have_text('#1') @@ -572,7 +594,7 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi expect(find(suggestions_dropdown)).to have_text('My Cool Milestone') - send_keys :enter + send_keys [:arrow_down, :enter] expect(page).not_to have_css(suggestions_dropdown) expect(page).to have_text('%My Cool Milestone') @@ -584,7 +606,7 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi expect(find(suggestions_dropdown)).to have_text('🙂 slight_smile') expect(find(suggestions_dropdown)).to have_text('😸 smile_cat') - send_keys :enter + send_keys [:arrow_down, :enter] expect(page).not_to have_css(suggestions_dropdown) @@ -614,7 +636,7 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi end def dropdown_scroll_top - evaluate_script("document.querySelector('#{suggestions_dropdown} .gl-dropdown-inner').scrollTop") + evaluate_script("document.querySelector('#{suggestions_dropdown}').scrollTop") end end end |