Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.rb16
1 files changed, 16 insertions, 0 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 7863548e7f3..f01e3c88dad 100644
--- a/spec/support/shared_examples/features/content_editor_shared_examples.rb
+++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb
@@ -313,5 +313,21 @@ RSpec.shared_examples 'edits content using the content editor' do
expect(page).not_to have_css(suggestions_dropdown)
end
+
+ it 'scrolls selected item into view when navigating with keyboard' do
+ type_in_content_editor ':'
+
+ expect(find(suggestions_dropdown)).to have_text('hundred points symbol')
+
+ expect(dropdown_scroll_top).to be 0
+
+ send_keys :arrow_up
+
+ expect(dropdown_scroll_top).to be > 100
+ end
+
+ def dropdown_scroll_top
+ evaluate_script("document.querySelector('#{suggestions_dropdown} .gl-new-dropdown-inner').scrollTop")
+ end
end
end