blob: e48f556c2466383099d4a590cfcab5175c5f91f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import { shallowMount } from '@vue/test-utils';
import { GlModal } from '@gitlab/ui';
import DeletePipelineScheduleModal from '~/ci/pipeline_schedules/components/delete_pipeline_schedule_modal.vue';
describe('Delete pipeline schedule modal', () => {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(DeletePipelineScheduleModal, {
propsData: {
visible: true,
...props,
},
});
};
const findModal = () => wrapper.findComponent(GlModal);
beforeEach(() => {
createComponent();
});
it('emits the deleteSchedule event', () => {
findModal().vm.$emit('primary');
expect(wrapper.emitted()).toEqual({ deleteSchedule: [[]] });
});
it('emits the hideModal event', () => {
findModal().vm.$emit('hide');
expect(wrapper.emitted()).toEqual({ hideModal: [[]] });
});
});
|