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,8 +152,11 @@ export default {
async created() {
if (this.isEdit) {
this.validateTargetUrl();
if (this.glFeatures.securityOnDemandScansSiteValidation) {
await this.fetchValidationStatus();
}
}
},
methods: {
validateTargetUrl() {
......
---
title: 'DAST on-demand site profiles: prevent error banner from showing'
merge_request: 42300
author:
type: fixed
......@@ -184,12 +184,19 @@ describe('DastSiteProfileForm', () => {
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(() => {
createComponent({
provide: {
glFeatures: { securityOnDemandScansSiteValidation: false },
},
propsData: {
siteProfile,
},
});
});
......@@ -197,6 +204,10 @@ describe('DastSiteProfileForm', () => {
expect(findSiteValidationToggle().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', () => {
......
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