diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/support/shared_examples/features/search_settings_shared_examples.rb | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) | |
download | gitlab-ce-9dc93a4519d9d5d7be48ff274127136236a3adb3.tar.gz |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/support/shared_examples/features/search_settings_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/search_settings_shared_examples.rb | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/spec/support/shared_examples/features/search_settings_shared_examples.rb b/spec/support/shared_examples/features/search_settings_shared_examples.rb index 6a507c4be56..dda780690b2 100644 --- a/spec/support/shared_examples/features/search_settings_shared_examples.rb +++ b/spec/support/shared_examples/features/search_settings_shared_examples.rb @@ -7,9 +7,7 @@ RSpec.shared_examples 'cannot search settings' do end RSpec.shared_examples 'can search settings' do |search_term, non_match_section| - it 'has search settings field' do - expect(page).to have_field(placeholder: SearchHelpers::INPUT_PLACEHOLDER) - end + it_behaves_like 'can highlight results', search_term it 'hides unmatching sections on search' do expect(page).to have_content(non_match_section) @@ -21,22 +19,19 @@ RSpec.shared_examples 'can search settings' do |search_term, non_match_section| end end -RSpec.shared_examples 'can search settings with feature flag check' do |search_term, non_match_section| - let(:flag) { true } - - before do - stub_feature_flags(search_settings_in_page: flag) - - visit(visit_path) +RSpec.shared_examples 'can highlight results' do |search_term| + it 'has search settings field' do + expect(page).to have_field(placeholder: SearchHelpers::INPUT_PLACEHOLDER) end - context 'with feature flag on' do - it_behaves_like 'can search settings', search_term, non_match_section - end + it 'highlights the search terms' do + selector = '.gl-bg-orange-100' + fill_in SearchHelpers::INPUT_PLACEHOLDER, with: search_term - context 'with feature flag off' do - let(:flag) { false } + expect(page).to have_css(selector) - it_behaves_like 'cannot search settings' + page.find_all(selector) do |element| + expect(element).to have_content(search_term) + end end end |