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>2022-06-22 00:09:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-22 00:09:41 +0300
commitc097ca59a16661859dc192ca1c02c957c3025d46 (patch)
treeb042da3b9a4b4cfa8e24dad1d7bced1a6034ca41 /spec
parentf0ccbae4dc1d8356a99f9b97361414aeb9a82337 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/environments/canary_update_modal_spec.js2
-rw-r--r--spec/frontend/groups/components/group_name_and_path_spec.js17
-rw-r--r--spec/initializers/100_patch_omniauth_oauth2_spec.rb2
-rw-r--r--spec/requests/api/projects_spec.rb2
4 files changed, 16 insertions, 7 deletions
diff --git a/spec/frontend/environments/canary_update_modal_spec.js b/spec/frontend/environments/canary_update_modal_spec.js
index 22d13558a84..16792dcda1e 100644
--- a/spec/frontend/environments/canary_update_modal_spec.js
+++ b/spec/frontend/environments/canary_update_modal_spec.js
@@ -47,7 +47,7 @@ describe('/environments/components/canary_update_modal.vue', () => {
modalId: 'confirm-canary-change',
actionPrimary: {
text: 'Change ratio',
- attributes: [{ variant: 'info' }],
+ attributes: [{ variant: 'confirm' }],
},
actionCancel: { text: 'Cancel' },
});
diff --git a/spec/frontend/groups/components/group_name_and_path_spec.js b/spec/frontend/groups/components/group_name_and_path_spec.js
index eaa0801ab50..9c9bdead6fa 100644
--- a/spec/frontend/groups/components/group_name_and_path_spec.js
+++ b/spec/frontend/groups/components/group_name_and_path_spec.js
@@ -1,3 +1,4 @@
+import { nextTick } from 'vue';
import { merge } from 'lodash';
import { GlAlert } from '@gitlab/ui';
import { mountExtended, extendedWrapper } from 'helpers/vue_test_utils_helper';
@@ -50,17 +51,17 @@ describe('GroupNameAndPath', () => {
const findAlert = () => extendedWrapper(wrapper.findComponent(GlAlert));
const apiMockAvailablePath = () => {
- getGroupPathAvailability.mockResolvedValue({
+ getGroupPathAvailability.mockResolvedValueOnce({
data: { exists: false, suggests: [] },
});
};
const apiMockUnavailablePath = (suggests = [mockGroupUrlSuggested]) => {
- getGroupPathAvailability.mockResolvedValue({
+ getGroupPathAvailability.mockResolvedValueOnce({
data: { exists: true, suggests },
});
};
const apiMockLoading = () => {
- getGroupPathAvailability.mockImplementation(() => new Promise(() => {}));
+ getGroupPathAvailability.mockImplementationOnce(() => new Promise(() => {}));
};
const expectLoadingMessageExists = () => {
@@ -169,7 +170,7 @@ describe('GroupNameAndPath', () => {
describe('when API call fails', () => {
it('calls `createAlert`', async () => {
- getGroupPathAvailability.mockRejectedValue({});
+ getGroupPathAvailability.mockRejectedValueOnce({});
createComponent();
@@ -184,14 +185,20 @@ describe('GroupNameAndPath', () => {
describe('when multiple API calls are in-flight', () => {
it('aborts the first API call and resolves second API call', async () => {
- apiMockLoading();
+ getGroupPathAvailability.mockRejectedValueOnce({ __CANCEL__: true });
apiMockUnavailablePath();
+
const abortSpy = jest.spyOn(AbortController.prototype, 'abort');
createComponent();
await findGroupNameField().setValue('Foo');
await findGroupNameField().setValue(mockGroupName);
+
+ // Wait for re-render to ensure loading message is still there
+ await nextTick();
+ expectLoadingMessageExists();
+
await waitForPromises();
expect(createAlert).not.toHaveBeenCalled();
diff --git a/spec/initializers/100_patch_omniauth_oauth2_spec.rb b/spec/initializers/100_patch_omniauth_oauth2_spec.rb
index c30a1cdeafa..36a14816b7e 100644
--- a/spec/initializers/100_patch_omniauth_oauth2_spec.rb
+++ b/spec/initializers/100_patch_omniauth_oauth2_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'OmniAuth::Strategies::OAuth2' do
it 'verifies the gem version' do
current_version = OmniAuth::OAuth2::VERSION
- expected_version = '1.7.2'
+ expected_version = '1.7.3'
expect(current_version).to eq(expected_version), <<~EOF
New version #{current_version} of the `omniauth-oauth2` gem detected!
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 431d2e56cb5..36f8270f2d3 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2388,6 +2388,7 @@ RSpec.describe API::Projects do
expect(json_response['only_allow_merge_if_all_discussions_are_resolved']).to eq(project.only_allow_merge_if_all_discussions_are_resolved)
expect(json_response['ci_default_git_depth']).to eq(project.ci_default_git_depth)
expect(json_response['ci_forward_deployment_enabled']).to eq(project.ci_forward_deployment_enabled)
+ expect(json_response['ci_separated_caches']).to eq(project.ci_separated_caches)
expect(json_response['merge_method']).to eq(project.merge_method.to_s)
expect(json_response['squash_option']).to eq(project.squash_option.to_s)
expect(json_response['readme_url']).to eq(project.readme_url)
@@ -3652,6 +3653,7 @@ RSpec.describe API::Projects do
merge_method: 'ff',
ci_default_git_depth: 20,
ci_forward_deployment_enabled: false,
+ ci_separated_caches: false,
description: 'new description' }
put api("/projects/#{project3.id}", user4), params: project_param