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/views/search/_results.html.haml_spec.rb')
-rw-r--r--spec/views/search/_results.html.haml_spec.rb36
1 files changed, 17 insertions, 19 deletions
diff --git a/spec/views/search/_results.html.haml_spec.rb b/spec/views/search/_results.html.haml_spec.rb
index 033b2304e33..6299fd0cf36 100644
--- a/spec/views/search/_results.html.haml_spec.rb
+++ b/spec/views/search/_results.html.haml_spec.rb
@@ -43,7 +43,7 @@ RSpec.describe 'search/_results' do
let_it_be(:wiki_blob) { create(:wiki_page, project: project, content: '*') }
let_it_be(:user) { create(:admin) }
- %w[issues blobs notes wiki_blobs merge_requests milestones].each do |search_scope|
+ %w[issues merge_requests].each do |search_scope|
context "when scope is #{search_scope}" do
let(:scope) { search_scope }
let(:search_objects) { Gitlab::ProjectSearchResults.new(user, '*', project: project).objects(scope) }
@@ -55,32 +55,30 @@ RSpec.describe 'search/_results' do
expect(rendered).to have_selector('[data-track-property=search_result]')
end
- it 'renders the state filter drop down' do
+ it 'does render the sidebar' do
render
- expect(rendered).to have_selector('#js-search-filter-by-state')
+ expect(rendered).to have_selector('#js-search-sidebar')
end
+ end
+ end
- context 'Feature search_filter_by_confidential' do
- context 'when disabled' do
- before do
- stub_feature_flags(search_filter_by_confidential: false)
- end
+ %w[blobs notes wiki_blobs milestones].each do |search_scope|
+ context "when scope is #{search_scope}" do
+ let(:scope) { search_scope }
+ let(:search_objects) { Gitlab::ProjectSearchResults.new(user, '*', project: project).objects(scope) }
- it 'does not render the confidential drop down' do
- render
+ it 'renders the click text event tracking attributes' do
+ render
- expect(rendered).not_to have_selector('#js-search-filter-by-confidential')
- end
- end
+ expect(rendered).to have_selector('[data-track-event=click_text]')
+ expect(rendered).to have_selector('[data-track-property=search_result]')
+ end
- context 'when enabled' do
- it 'renders the confidential drop down' do
- render
+ it 'does not render the sidebar' do
+ render
- expect(rendered).to have_selector('#js-search-filter-by-confidential')
- end
- end
+ expect(rendered).not_to have_selector('#js-search-sidebar')
end
end
end