Commit 91c0aa62 authored by Mark Florian's avatar Mark Florian

Merge branch '249439-dast-on-demand-site-profile-edit-page-shows-error-banner' into 'master'

DAST on-demand site profiles: prevent error banner from showing

See merge request gitlab-org/gitlab!42300
parents 8c871ce3 7ad9bd61
...@@ -152,7 +152,10 @@ export default { ...@@ -152,7 +152,10 @@ export default {
async created() { async created() {
if (this.isEdit) { if (this.isEdit) {
this.validateTargetUrl(); this.validateTargetUrl();
await this.fetchValidationStatus();
if (this.glFeatures.securityOnDemandScansSiteValidation) {
await this.fetchValidationStatus();
}
} }
}, },
methods: { methods: {
......
---
title: 'DAST on-demand site profiles: prevent error banner from showing'
merge_request: 42300
author:
type: fixed
...@@ -184,12 +184,19 @@ describe('DastSiteProfileForm', () => { ...@@ -184,12 +184,19 @@ describe('DastSiteProfileForm', () => {
await findSiteValidationToggle().vm.$emit('change', true); await findSiteValidationToggle().vm.$emit('change', true);
}; };
describe('with feature flag disabled', () => { describe.each`
title | siteProfile
${'New site profile'} | ${null}
${'Edit site profile'} | ${{ id: 1, name: 'foo', targetUrl: 'bar' }}
`('$title with feature flag disabled', ({ siteProfile }) => {
beforeEach(() => { beforeEach(() => {
createComponent({ createComponent({
provide: { provide: {
glFeatures: { securityOnDemandScansSiteValidation: false }, glFeatures: { securityOnDemandScansSiteValidation: false },
}, },
propsData: {
siteProfile,
},
}); });
}); });
...@@ -197,6 +204,10 @@ describe('DastSiteProfileForm', () => { ...@@ -197,6 +204,10 @@ describe('DastSiteProfileForm', () => {
expect(findSiteValidationToggle().exists()).toBe(false); expect(findSiteValidationToggle().exists()).toBe(false);
expect(findDastSiteValidation().exists()).toBe(false); expect(findDastSiteValidation().exists()).toBe(false);
}); });
it('does not check the target URLs validation status', () => {
expect(requestHandlers.dastSiteValidation).not.toHaveBeenCalled();
});
}); });
describe('with feature flag enabled', () => { describe('with feature flag enabled', () => {
......
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