diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 16:00:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-01 16:00:51 +0000 |
commit | b2e9603724fc002b87cc23926a613b4e7ab10a42 (patch) | |
tree | 53b0a2aa2157561545516f0d2baa50de81094fb5 /spec/support | |
parent | a5131ced0f04bd5e8bc58fc54b60f5e93ed93b4c (diff) | |
download | gitlab-ce-b2e9603724fc002b87cc23926a613b4e7ab10a42.tar.gz |
Add latest changes from gitlab-org/gitlab@14-3-stable-ee
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/database/cross-join-allowlist.yml | 1 | ||||
-rw-r--r-- | spec/support/helpers/filtered_search_helpers.rb | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/database/cross-join-allowlist.yml b/spec/support/database/cross-join-allowlist.yml index 2b4cfc6773a..45e95cf3262 100644 --- a/spec/support/database/cross-join-allowlist.yml +++ b/spec/support/database/cross-join-allowlist.yml @@ -115,6 +115,7 @@ - "./spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb" - "./spec/lib/gitlab/prometheus/query_variables_spec.rb" - "./spec/mailers/emails/pipelines_spec.rb" +- "./spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb" - "./spec/migrations/cleanup_legacy_artifact_migration_spec.rb" - "./spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb" - "./spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb" diff --git a/spec/support/helpers/filtered_search_helpers.rb b/spec/support/helpers/filtered_search_helpers.rb index 10068b9c508..b6cf78b9046 100644 --- a/spec/support/helpers/filtered_search_helpers.rb +++ b/spec/support/helpers/filtered_search_helpers.rb @@ -101,6 +101,27 @@ module FilteredSearchHelpers end end + # Same as `expect_tokens` but works with GlFilteredSearch + def expect_vue_tokens(tokens) + page.within '.gl-search-box-by-click .gl-filtered-search-scrollable' do + token_elements = page.all(:css, '.gl-filtered-search-token') + + tokens.each_with_index do |token, index| + el = token_elements[index] + + expect(el.find('.gl-filtered-search-token-type')).to have_content(token[:name]) + expect(el.find('.gl-filtered-search-token-operator')).to have_content(token[:operator]) if token[:operator].present? + expect(el.find('.gl-filtered-search-token-data')).to have_content(token[:value]) if token[:value].present? + + # gl-emoji content is blank when the emoji unicode is not supported + if token[:emoji_name].present? + selector = %(gl-emoji[data-name="#{token[:emoji_name]}"]) + expect(el.find('.gl-filtered-search-token-data-content')).to have_css(selector) + end + end + end + end + def create_token(token_name, token_value = nil, symbol = nil, token_operator = '=') { name: token_name, operator: token_operator, value: "#{symbol}#{token_value}" } end |