summaryrefslogtreecommitdiff
path: root/spec/features/issues/filtered_search
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/issues/filtered_search')
-rw-r--r--spec/features/issues/filtered_search/recent_searches_spec.rb21
-rw-r--r--spec/features/issues/filtered_search/visual_tokens_spec.rb4
2 files changed, 23 insertions, 2 deletions
diff --git a/spec/features/issues/filtered_search/recent_searches_spec.rb b/spec/features/issues/filtered_search/recent_searches_spec.rb
index 85b7a093536..61c1e35f3c8 100644
--- a/spec/features/issues/filtered_search/recent_searches_spec.rb
+++ b/spec/features/issues/filtered_search/recent_searches_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'Recent searches', :js do
include FilteredSearchHelpers
+ include MobileHelpers
let(:project_1) { create(:project, :public) }
let(:project_2) { create(:project, :public) }
@@ -104,4 +105,24 @@ RSpec.describe 'Recent searches', :js do
expect(find('.flash-alert')).to have_text('An error occurred while parsing recent searches')
end
+
+ context 'on tablet/mobile screen' do
+ it 'shows only the history icon in the dropdown' do
+ resize_screen_sm
+ visit project_issues_path(project_1)
+
+ expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('svg', visible: true)
+ expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('span', text: 'Recent searches', visible: false)
+ end
+ end
+
+ context 'on PC screen' do
+ it 'shows only the Recent searches text in the dropdown' do
+ restore_window_size
+ visit project_issues_path(project_1)
+
+ expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('svg', visible: false)
+ expect(find('.filtered-search-history-dropdown-wrapper')).to have_selector('span', text: 'Recent searches', visible: true)
+ end
+ end
end
diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb
index 59588978a8e..c585d7f6194 100644
--- a/spec/features/issues/filtered_search/visual_tokens_spec.rb
+++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb
@@ -53,7 +53,7 @@ RSpec.describe 'Visual tokens', :js do
end
it 'ends editing mode when document is clicked' do
- find('#content-body').click
+ find('.js-navbar').click
expect_filtered_search_input_empty
expect(page).to have_css('#js-dropdown-author', visible: false)
@@ -142,7 +142,7 @@ RSpec.describe 'Visual tokens', :js do
it 'does not tokenize incomplete token' do
filtered_search.send_keys('author:=')
- find('body').click
+ find('.js-navbar').click
token = page.all('.tokens-container .js-visual-token')[1]
expect_filtered_search_input_empty