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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-22 21:10:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-22 21:10:38 +0300
commit7e2f555a6dc37839727dee130d8ed4421b680d42 (patch)
treef2bcca7814bbaa6ee50e14830bc3a74307b1148e /spec/frontend/ci
parent4ec96676406da695de083b4f394290902da2a964 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci')
-rw-r--r--spec/frontend/ci/runner/components/runner_create_form_spec.js3
-rw-r--r--spec/frontend/ci/runner/components/runner_form_fields_spec.js30
2 files changed, 32 insertions, 1 deletions
diff --git a/spec/frontend/ci/runner/components/runner_create_form_spec.js b/spec/frontend/ci/runner/components/runner_create_form_spec.js
index 329dd2f73ee..243d23aeb38 100644
--- a/spec/frontend/ci/runner/components/runner_create_form_spec.js
+++ b/spec/frontend/ci/runner/components/runner_create_form_spec.js
@@ -21,12 +21,14 @@ jest.mock('~/ci/runner/sentry_utils');
const mockCreatedRunner = runnerCreateResult.data.runnerCreate.runner;
const defaultRunnerModel = {
+ runnerType: INSTANCE_TYPE,
description: '',
accessLevel: DEFAULT_ACCESS_LEVEL,
paused: false,
maintenanceNote: '',
maximumTimeout: '',
runUntagged: false,
+ locked: false,
tagList: '',
};
@@ -81,6 +83,7 @@ describe('RunnerCreateForm', () => {
findRunnerFormFields().vm.$emit('input', {
...defaultRunnerModel,
+ runnerType: props.runnerType,
description: 'My runner',
maximumTimeout: 0,
tagList: 'tag1, tag2',
diff --git a/spec/frontend/ci/runner/components/runner_form_fields_spec.js b/spec/frontend/ci/runner/components/runner_form_fields_spec.js
index 5b429645d17..0e2f2aa2e91 100644
--- a/spec/frontend/ci/runner/components/runner_form_fields_spec.js
+++ b/spec/frontend/ci/runner/components/runner_form_fields_spec.js
@@ -1,7 +1,11 @@
import { nextTick } from 'vue';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import RunnerFormFields from '~/ci/runner/components/runner_form_fields.vue';
-import { ACCESS_LEVEL_NOT_PROTECTED, ACCESS_LEVEL_REF_PROTECTED } from '~/ci/runner/constants';
+import {
+ ACCESS_LEVEL_NOT_PROTECTED,
+ ACCESS_LEVEL_REF_PROTECTED,
+ PROJECT_TYPE,
+} from '~/ci/runner/constants';
const mockDescription = 'My description';
const mockMaxTimeout = 60;
@@ -63,6 +67,30 @@ describe('RunnerFormFields', () => {
});
});
+ it('locked checkbox is not shown', () => {
+ createComponent();
+
+ expect(findInput('locked').exists()).toBe(false);
+ });
+
+ it('when runner is of project type, locked checkbox can be checked', async () => {
+ createComponent({
+ runner: {
+ runnerType: PROJECT_TYPE,
+ locked: false,
+ },
+ });
+
+ findInput('locked').setChecked(true);
+
+ await nextTick();
+
+ expect(wrapper.emitted('input')[0][0]).toEqual({
+ runnerType: PROJECT_TYPE,
+ locked: true,
+ });
+ });
+
it('unchecks checkbox fields', async () => {
createComponent({
runner: {