Remove OnDemandScansApp component

Removes the OnDemandScansApp component which used to be the entry point
for On-demand scans but was eventually replaced with OnDemandScansForm.
parent e5dfb288
<script>
import OnDemandScansForm from './on_demand_scans_form.vue';
export default {
name: 'OnDemandScansApp',
components: {
OnDemandScansForm,
},
props: {
helpPagePath: {
type: String,
required: true,
},
projectPath: {
type: String,
required: true,
},
defaultBranch: {
type: String,
required: false,
default: '',
},
emptyStateSvgPath: {
type: String,
required: true,
},
},
data() {
return {
showForm: false,
};
},
};
</script>
<template>
<div>
<on-demand-scans-form
:help-page-path="helpPagePath"
:project-path="projectPath"
:default-branch="defaultBranch"
/>
</div>
</template>
import { shallowMount } from '@vue/test-utils';
import { merge } from 'lodash';
import OnDemandScansApp from 'ee/on_demand_scans/components/on_demand_scans_app.vue';
import OnDemandScansForm from 'ee/on_demand_scans/components/on_demand_scans_form.vue';
import { TEST_HOST } from 'helpers/test_constants';
const helpPagePath = `${TEST_HOST}/application_security/dast/index#on-demand-scans`;
const projectPath = 'group/project';
const defaultBranch = 'master';
const emptyStateSvgPath = `${TEST_HOST}/assets/illustrations/alert-management-empty-state.svg`;
const newSiteProfilePath = `${TEST_HOST}/${projectPath}/-/security/configuration/dast_scans`;
describe('OnDemandScansApp', () => {
let wrapper;
const findOnDemandScansForm = () => wrapper.find(OnDemandScansForm);
const expectForm = () => {
expect(wrapper.find(OnDemandScansForm).exists()).toBe(true);
};
const createComponent = (options) => {
wrapper = shallowMount(
OnDemandScansApp,
merge(
{},
{
propsData: {
helpPagePath,
projectPath,
defaultBranch,
emptyStateSvgPath,
newSiteProfilePath,
},
},
options,
),
);
};
beforeEach(() => {
createComponent();
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
describe('form', () => {
it('renders the form', () => {
expectForm();
});
it('passes correct props to OnDemandScansForm', () => {
expect(findOnDemandScansForm().props()).toMatchObject({
helpPagePath,
projectPath,
defaultBranch,
});
});
});
});
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