Merge pull request #8545 from nixocio/ui_issue_4968

Mark `Host Config Key` as a required field

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-11-06 17:23:16 +00:00 committed by GitHub
commit 862a6835fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -36,7 +36,7 @@ const mockJobTemplate = {
diff_mode: false,
extra_vars: '---',
forks: 0,
host_config_key: '',
host_config_key: '1234',
id: 1,
inventory: 2,
job_slice_count: 1,
@ -225,6 +225,10 @@ describe('<JobTemplateEdit />', () => {
);
});
await waitForElement(wrapper, 'EmptyStateBody', el => el.length === 0);
expect(wrapper.find('FormGroup[label="Host Config Key"]').length).toBe(1);
expect(
wrapper.find('FormGroup[label="Host Config Key"]').prop('isRequired')
).toBe(true);
});
test('handleSubmit should call api update', async () => {

View File

@ -589,6 +589,7 @@ function JobTemplateForm({
validate={
allowCallbacks ? required(null, i18n) : null
}
isRequired={allowCallbacks}
/>
</FormColumnLayout>
</>

View File

@ -56,6 +56,7 @@ describe('<JobTemplateForm />', () => {
webhook_key: 'webhook key',
webhook_service: 'github',
webhook_credential: 7,
host_config_key: '',
};
const mockInstanceGroups = [
{