Commit b7829af5 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '271260-remove--toggle-for-locked-where-not-used' into 'master'

Remove runner "locked" toggle where not used

See merge request gitlab-org/gitlab!68833
parents fff7ebeb 64291433
...@@ -135,9 +135,9 @@ export default { ...@@ -135,9 +135,9 @@ export default {
</gl-form-checkbox> </gl-form-checkbox>
<gl-form-checkbox <gl-form-checkbox
v-if="canBeLockedToProject"
v-model="model.locked" v-model="model.locked"
data-testid="runner-field-locked" data-testid="runner-field-locked"
:disabled="!canBeLockedToProject"
> >
{{ __('Lock to current projects') }} {{ __('Lock to current projects') }}
<template #help> <template #help>
......
...@@ -54,7 +54,7 @@ describe('RunnerUpdateForm', () => { ...@@ -54,7 +54,7 @@ describe('RunnerUpdateForm', () => {
? ACCESS_LEVEL_REF_PROTECTED ? ACCESS_LEVEL_REF_PROTECTED
: ACCESS_LEVEL_NOT_PROTECTED, : ACCESS_LEVEL_NOT_PROTECTED,
runUntagged: findRunUntaggedCheckbox().element.checked, runUntagged: findRunUntaggedCheckbox().element.checked,
locked: findLockedCheckbox().element.checked, locked: findLockedCheckbox().element?.checked || false,
ipAddress: findIpInput().element.value, ipAddress: findIpInput().element.value,
maximumTimeout: findMaxJobTimeoutInput().element.value || null, maximumTimeout: findMaxJobTimeoutInput().element.value || null,
tagList: findTagsInput().element.value.split(',').filter(Boolean), tagList: findTagsInput().element.value.split(',').filter(Boolean),
...@@ -153,15 +153,15 @@ describe('RunnerUpdateForm', () => { ...@@ -153,15 +153,15 @@ describe('RunnerUpdateForm', () => {
}); });
it.each` it.each`
runnerType | attrDisabled | outcome runnerType | exists | outcome
${INSTANCE_TYPE} | ${'disabled'} | ${'disabled'} ${INSTANCE_TYPE} | ${false} | ${'hidden'}
${GROUP_TYPE} | ${'disabled'} | ${'disabled'} ${GROUP_TYPE} | ${false} | ${'hidden'}
${PROJECT_TYPE} | ${undefined} | ${'enabled'} ${PROJECT_TYPE} | ${true} | ${'shown'}
`(`When runner is $runnerType, locked field is $outcome`, ({ runnerType, attrDisabled }) => { `(`When runner is $runnerType, locked field is $outcome`, ({ runnerType, exists }) => {
const runner = { ...mockRunner, runnerType }; const runner = { ...mockRunner, runnerType };
createComponent({ props: { runner } }); createComponent({ props: { runner } });
expect(findLockedCheckbox().attributes('disabled')).toBe(attrDisabled); expect(findLockedCheckbox().exists()).toBe(exists);
}); });
describe('On submit, runner gets updated', () => { describe('On submit, runner gets updated', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment