Commit 8034db53 authored by Dheeraj Joshi's avatar Dheeraj Joshi Committed by Natalia Tepluhina

Revert: Enable submit by default in DAST Scanner Profile

parent 1d348115
......@@ -141,7 +141,7 @@ export default {
);
},
isSubmitDisabled() {
return this.isPolicyProfile;
return this.formHasErrors || this.requiredFieldEmpty || this.isPolicyProfile;
},
isPolicyProfile() {
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', () => {
createComponent();
});
describe('is enabled even if', () => {
describe('is disabled if', () => {
it('form contains errors', async () => {
findProfileNameInput().vm.$emit('input', profileName);
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 () => {
findProfileNameInput().vm.$emit('input', '');
await findSpiderTimeoutInput().vm.$emit('input', spiderTimeout);
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