diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-29 15:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-29 15:08:09 +0300 |
commit | 1a8b381312dc666a93c1bc3879ad15b1350de300 (patch) | |
tree | 58e744b5a04e9df5b2aefe6990ac28389b9698e2 /spec | |
parent | 55dea17c8d10d1b25cd25f1cdaeaed64332995a7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
5 files changed, 34 insertions, 3 deletions
diff --git a/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js b/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js index 5887670a58d..ea7dabf34c9 100644 --- a/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/widget/widget_spec.js @@ -287,6 +287,21 @@ describe('~/vue_merge_request_widget/components/widget/widget.vue', () => { expect(findExpandedSection().text()).toBe('More complex content'); }); + it('emits a toggle even when button is toggled', async () => { + createComponent({ + propsData: { + isCollapsible: true, + }, + slots: { + content: '<b>More complex content</b>', + }, + }); + + expect(findExpandedSection().exists()).toBe(false); + findToggleButton().vm.$emit('click'); + expect(wrapper.emitted('toggle')).toEqual([[{ expanded: true }]]); + }); + it('does not display the toggle button if isCollapsible is false', () => { createComponent({ propsData: { diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js index 9941abbfaea..f115ec2d6ca 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js @@ -18,6 +18,7 @@ import { OPTIONS_NONE_ANY, OPERATOR_IS, OPERATOR_NOT, + OPERATOR_OR, } from '~/vue_shared/components/filtered_search_bar/constants'; import { getRecentlyUsedSuggestions, @@ -300,6 +301,7 @@ describe('BaseToken', () => { operator | shouldRenderFilteredSearchSuggestion ${OPERATOR_IS} | ${true} ${OPERATOR_NOT} | ${false} + ${OPERATOR_OR} | ${false} `('when operator is $operator', ({ shouldRenderFilteredSearchSuggestion, operator }) => { beforeEach(() => { const props = { diff --git a/spec/lib/gitlab/ci/variables/builder_spec.rb b/spec/lib/gitlab/ci/variables/builder_spec.rb index 2c6f0320242..914159c0984 100644 --- a/spec/lib/gitlab/ci/variables/builder_spec.rb +++ b/spec/lib/gitlab/ci/variables/builder_spec.rb @@ -101,6 +101,8 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache, featur value: project.pages_url }, { key: 'CI_API_V4_URL', value: API::Helpers::Version.new('v4').root_url }, + { key: 'CI_API_GRAPHQL_URL', + value: Gitlab::Routing.url_helpers.api_graphql_url }, { key: 'CI_TEMPLATE_REGISTRY_HOST', value: template_registry_host }, { key: 'CI_PIPELINE_IID', diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index e93b5733d1a..880e1d3bcee 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2788,6 +2788,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def public: true, masked: false }, { key: 'CI_API_V4_URL', value: 'http://localhost/api/v4', public: true, masked: false }, + { key: 'CI_API_GRAPHQL_URL', value: 'http://localhost/api/graphql', public: true, masked: false }, { key: 'CI_TEMPLATE_REGISTRY_HOST', value: template_registry_host, public: true, masked: false }, { key: 'CI_PIPELINE_IID', value: pipeline.iid.to_s, public: true, masked: false }, { key: 'CI_PIPELINE_SOURCE', value: pipeline.source, public: true, masked: false }, diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 11adbf161ee..1348ca4f3b3 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -5807,8 +5807,19 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do let_it_be(:project) { create(:project) } it 'exposes API v4 URL' do - expect(project.api_variables.first[:key]).to eq 'CI_API_V4_URL' - expect(project.api_variables.first[:value]).to include '/api/v4' + v4_variable = project.api_variables.find { |variable| variable[:key] == "CI_API_V4_URL" } + + expect(v4_variable).not_to be_nil + expect(v4_variable[:key]).to eq 'CI_API_V4_URL' + expect(v4_variable[:value]).to end_with '/api/v4' + end + + it 'exposes API GraphQL URL' do + graphql_variable = project.api_variables.find { |variable| variable[:key] == "CI_API_GRAPHQL_URL" } + + expect(graphql_variable).not_to be_nil + expect(graphql_variable[:key]).to eq 'CI_API_GRAPHQL_URL' + expect(graphql_variable[:value]).to end_with '/api/graphql' end it 'contains a URL variable for every supported API version' do @@ -5823,7 +5834,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do end expect(project.api_variables.map { |variable| variable[:key] }) - .to contain_exactly(*required_variables) + .to include(*required_variables) end end |