Commit a560d34d authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'djadmin-scanner-profile-revert-submit-button' into 'master'

Revert: Enable submit by default in DAST Scanner Profile

See merge request gitlab-org/gitlab!59245
parents 17ab0881 8034db53
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
); );
}, },
isSubmitDisabled() { isSubmitDisabled() {
return this.isPolicyProfile; return this.formHasErrors || this.requiredFieldEmpty || this.isPolicyProfile;
}, },
isPolicyProfile() { isPolicyProfile() {
return Boolean(this.profile?.referencedInSecurityPolicies?.length); return Boolean(this.profile?.referencedInSecurityPolicies?.length);
......
---
title: Always display submit button for DAST Scanner Profile form
merge_request: 56928
author:
type: changed
...@@ -94,18 +94,18 @@ describe('DAST Scanner Profile', () => { ...@@ -94,18 +94,18 @@ describe('DAST Scanner Profile', () => {
createComponent(); createComponent();
}); });
describe('is enabled even if', () => { describe('is disabled if', () => {
it('form contains errors', async () => { it('form contains errors', async () => {
findProfileNameInput().vm.$emit('input', profileName); findProfileNameInput().vm.$emit('input', profileName);
await findSpiderTimeoutInput().vm.$emit('input', '12312'); await findSpiderTimeoutInput().vm.$emit('input', '12312');
expect(findSubmitButton().props('disabled')).toBe(false); expect(findSubmitButton().props('disabled')).toBe(true);
}); });
it('at least one field is empty', async () => { it('at least one field is empty', async () => {
findProfileNameInput().vm.$emit('input', ''); findProfileNameInput().vm.$emit('input', '');
await findSpiderTimeoutInput().vm.$emit('input', spiderTimeout); await findSpiderTimeoutInput().vm.$emit('input', spiderTimeout);
await findTargetTimeoutInput().vm.$emit('input', targetTimeout); await findTargetTimeoutInput().vm.$emit('input', targetTimeout);
expect(findSubmitButton().props('disabled')).toBe(false); expect(findSubmitButton().props('disabled')).toBe(true);
}); });
}); });
......
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