Commit dad4d6d5 authored by Mark Florian's avatar Mark Florian

Merge branch '296823-remove-ondemandscansapp-component' into 'master'

Remove OnDemandScansApp component

See merge request gitlab-org/gitlab!59287
parents 02c91aec cd338e9e
<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