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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 21:13:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 21:13:09 +0300
commit39406b41a6f3178feea7153bb2ce7343bc193e93 (patch)
tree14a3c75872a5fa82da4be58307e2a902250ce732 /spec
parenta4bc9e75d8078f37e9c196333a3a1484e97d6a71 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/lib/utils/text_utility_spec.js8
-rw-r--r--spec/frontend/work_items/mock_data.js8
-rw-r--r--spec/models/user_spec.rb14
-rw-r--r--spec/requests/projects/gcp/artifact_registry/docker_images_controller_spec.rb1
-rw-r--r--spec/support/helpers/database/duplicate_indexes.yml6
5 files changed, 37 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/text_utility_spec.js b/spec/frontend/lib/utils/text_utility_spec.js
index 6821ed56857..692beac7ed3 100644
--- a/spec/frontend/lib/utils/text_utility_spec.js
+++ b/spec/frontend/lib/utils/text_utility_spec.js
@@ -42,6 +42,14 @@ describe('text_utility', () => {
it('returns string with first letter capitalized', () => {
expect(textUtils.capitalizeFirstCharacter('gitlab')).toEqual('Gitlab');
});
+
+ it('returns empty string when given string is empty', () => {
+ expect(textUtils.capitalizeFirstCharacter('')).toEqual('');
+ });
+
+ it('returns empty string when given string is invalid', () => {
+ expect(textUtils.capitalizeFirstCharacter(undefined)).toEqual('');
+ });
});
describe('slugify', () => {
diff --git a/spec/frontend/work_items/mock_data.js b/spec/frontend/work_items/mock_data.js
index 9e39380750f..ce1919fb6d0 100644
--- a/spec/frontend/work_items/mock_data.js
+++ b/spec/frontend/work_items/mock_data.js
@@ -229,6 +229,7 @@ export const updateWorkItemMutationResponse = {
state: 'OPEN',
description: 'description',
confidential: false,
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
createdAt: '2022-08-03T12:41:54Z',
updatedAt: '2022-08-08T12:41:54Z',
closedAt: null,
@@ -339,6 +340,7 @@ export const convertWorkItemMutationResponse = {
title: 'Updated title',
state: 'OPEN',
description: 'description',
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
confidential: false,
createdAt: '2022-08-03T12:41:54Z',
updatedAt: '2022-08-08T12:41:54Z',
@@ -644,6 +646,7 @@ export const workItemResponseFactory = ({
title: 'Updated title',
state,
description: 'description',
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
confidential,
createdAt,
updatedAt,
@@ -923,6 +926,7 @@ export const createWorkItemMutationResponse = {
createdAt: '2022-08-03T12:41:54Z',
updatedAt: null,
closedAt: null,
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
author: {
...mockAssignees[0],
},
@@ -1010,6 +1014,7 @@ export const workItemHierarchyEmptyResponse = {
__typename: 'WorkItemType',
},
title: 'New title',
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
description: '',
createdAt: '2022-08-03T12:41:54Z',
updatedAt: null,
@@ -1229,6 +1234,7 @@ export const workItemHierarchyResponse = {
__typename: 'WorkItemType',
},
title: 'New title',
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
userPermissions: {
deleteWorkItem: true,
updateWorkItem: true,
@@ -1495,6 +1501,7 @@ export const changeIndirectWorkItemParentMutationResponse = {
__typename: 'WorkItemPermissions',
},
description: null,
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
id: 'gid://gitlab/WorkItem/13',
iid: '13',
archived: false,
@@ -1564,6 +1571,7 @@ export const changeWorkItemParentMutationResponse = {
__typename: 'WorkItemPermissions',
},
description: null,
+ webUrl: 'http://gdk.test/gitlab-org/gitlab/-/issues/1',
id: 'gid://gitlab/WorkItem/2',
iid: '2',
archived: false,
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index cc0ea69401e..d098f0b4c4a 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1434,6 +1434,20 @@ RSpec.describe User, feature_category: :user_profile do
end
end
+ describe '.ordered_by_id_desc' do
+ let_it_be(:first_user) { create(:user) }
+ let_it_be(:second_user) { create(:user) }
+
+ it 'generates the order SQL in descending order' do
+ expect(described_class.ordered_by_id_desc.to_sql).to include(
+ 'ORDER BY "users"."id" DESC')
+ end
+
+ it 'sorts users correctly' do
+ expect(described_class.ordered_by_id_desc).to eq([second_user, first_user])
+ end
+ end
+
describe '.trusted' do
let_it_be(:trusted_user1) { create(:user, :trusted) }
let_it_be(:trusted_user2) { create(:user, :trusted) }
diff --git a/spec/requests/projects/gcp/artifact_registry/docker_images_controller_spec.rb b/spec/requests/projects/gcp/artifact_registry/docker_images_controller_spec.rb
index d571999feb0..8c5bdd1a516 100644
--- a/spec/requests/projects/gcp/artifact_registry/docker_images_controller_spec.rb
+++ b/spec/requests/projects/gcp/artifact_registry/docker_images_controller_spec.rb
@@ -58,6 +58,7 @@ RSpec.describe Projects::Gcp::ArtifactRegistry::DockerImagesController, feature_
expect(response.body).to include('tag2')
expect(response.body).to include('Prev')
expect(response.body).to include('Next')
+ expect(response.body).to include('https://location.pkg.dev/project/repo/image@sha256:6a')
end
context 'when the service returns an error response' do
diff --git a/spec/support/helpers/database/duplicate_indexes.yml b/spec/support/helpers/database/duplicate_indexes.yml
index ab9935a7a98..cbb0b0be457 100644
--- a/spec/support/helpers/database/duplicate_indexes.yml
+++ b/spec/support/helpers/database/duplicate_indexes.yml
@@ -27,6 +27,9 @@ boards_epic_board_recent_visits:
boards_epic_user_preferences:
index_boards_epic_user_preferences_on_board_user_epic_unique:
- index_boards_epic_user_preferences_on_board_id
+ci_build_trace_metadata:
+ index_ci_build_trace_metadata_on_trace_artifact_id:
+ - index_ci_build_trace_metadata_on_trace_artifact_id_partition_id
ci_job_artifacts:
index_ci_job_artifacts_on_id_project_id_and_created_at:
- index_ci_job_artifacts_on_project_id
@@ -34,6 +37,9 @@ ci_job_artifacts:
- index_ci_job_artifacts_on_project_id
index_ci_job_artifacts_on_project_id_and_id:
- index_ci_job_artifacts_on_project_id
+ci_job_artifact_states:
+ index_ci_job_artifact_states_on_job_artifact_id:
+ - index_ci_job_artifact_states_on_job_artifact_id_partition_id
ci_pipeline_artifacts:
index_ci_pipeline_artifacts_on_pipeline_id_and_file_type:
- index_ci_pipeline_artifacts_on_pipeline_id