diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 00:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 00:07:14 +0300 |
commit | b04f912deb494b6dc0d0dba36776a5e53f622b43 (patch) | |
tree | b6af17cf69082cda35c42801a123c6e090b28c12 /spec | |
parent | 9e5484cee690f8bb2c1796013345d8cbc1872d77 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/db/schema_spec.rb | 2 | ||||
-rw-r--r-- | spec/frontend/tags/components/sort_dropdown_spec.js | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab_settings/options_spec.rb | 14 |
4 files changed, 23 insertions, 9 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index 060b337d4a6..4ec6d3ad4f5 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -87,7 +87,7 @@ RSpec.describe 'Database schema', feature_category: :database do oauth_access_grants: %w[resource_owner_id application_id], oauth_access_tokens: %w[resource_owner_id application_id], oauth_applications: %w[owner_id], - p_ci_runner_machine_builds: %w[partition_id build_id], + p_ci_builds: %w[project_id runner_id user_id erased_by_id trigger_request_id partition_id], product_analytics_events_experimental: %w[event_id txn_id user_id], project_build_artifacts_size_refreshes: %w[last_job_artifact_id], project_data_transfers: %w[project_id namespace_id], diff --git a/spec/frontend/tags/components/sort_dropdown_spec.js b/spec/frontend/tags/components/sort_dropdown_spec.js index e0ff370d313..ebf79c93f9b 100644 --- a/spec/frontend/tags/components/sort_dropdown_spec.js +++ b/spec/frontend/tags/components/sort_dropdown_spec.js @@ -1,4 +1,4 @@ -import { GlDropdownItem, GlSearchBoxByClick } from '@gitlab/ui'; +import { GlListboxItem, GlSearchBoxByClick } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import * as urlUtils from '~/lib/utils/url_utility'; @@ -39,9 +39,9 @@ describe('Tags sort dropdown', () => { }); it('should have a sort order dropdown', () => { - const branchesDropdown = findTagsDropdown(); + const tagsDropdown = findTagsDropdown(); - expect(branchesDropdown.exists()).toBe(true); + expect(tagsDropdown.exists()).toBe(true); }); }); @@ -63,9 +63,9 @@ describe('Tags sort dropdown', () => { }); it('should send a sort parameter', () => { - const sortDropdownItems = findTagsDropdown().findAllComponents(GlDropdownItem).at(0); + const sortDropdownItem = findTagsDropdown().findAllComponents(GlListboxItem).at(0); - sortDropdownItems.vm.$emit('click'); + sortDropdownItem.trigger('click'); expect(urlUtils.visitUrl).toHaveBeenCalledWith( '/root/ci-cd-project-demo/-/tags?sort=name_asc', diff --git a/spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb b/spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb index faf0447c054..37075c4d2df 100644 --- a/spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb @@ -78,13 +78,13 @@ RSpec.describe Gitlab::Database::MigrationHelpers::RestrictGitlabSchema, query_a } } }, - "does add column to ci_builds in gitlab_main and gitlab_ci" => { + "does add column to p_ci_builds in gitlab_main and gitlab_ci" => { migration: ->(klass) do def change - add_column :ci_builds, :__test_column, :integer + add_column :p_ci_builds, :__test_column, :integer end end, - query_matcher: /ALTER TABLE "ci_builds" ADD "__test_column" integer/, + query_matcher: /ALTER TABLE "p_ci_builds" ADD "__test_column" integer/, expected: { no_gitlab_schema: { main: :success, diff --git a/spec/lib/gitlab_settings/options_spec.rb b/spec/lib/gitlab_settings/options_spec.rb index 4b57e91c2e1..23cb2180edd 100644 --- a/spec/lib/gitlab_settings/options_spec.rb +++ b/spec/lib/gitlab_settings/options_spec.rb @@ -81,6 +81,20 @@ RSpec.describe GitlabSettings::Options, :aggregate_failures, feature_category: : end end + describe '#dup' do + it 'returns a deep copy' do + new_options = options.dup + expect(options.to_hash).to eq('foo' => { 'bar' => 'baz' }) + expect(new_options.to_hash).to eq(options.to_hash) + + new_options['test'] = 1 + new_options['foo']['bar'] = 'zzz' + + expect(options.to_hash).to eq('foo' => { 'bar' => 'baz' }) + expect(new_options.to_hash).to eq('test' => 1, 'foo' => { 'bar' => 'zzz' }) + end + end + describe '#merge' do it 'merges a hash to the existing options' do expect(options.merge(more: 'configs').to_hash).to eq( |