debian-mirror-gitlab/spec/frontend/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js
2022-06-21 17:19:12 +05:30

27 lines
699 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import { GlDrawer } from '@gitlab/ui';
import PipelineEditorDrawer from '~/pipeline_editor/components/drawer/pipeline_editor_drawer.vue';
describe('Pipeline editor drawer', () => {
let wrapper;
const findDrawer = () => wrapper.findComponent(GlDrawer);
const createComponent = () => {
wrapper = shallowMount(PipelineEditorDrawer);
};
afterEach(() => {
wrapper.destroy();
});
it('emits close event when closing the drawer', () => {
createComponent();
expect(wrapper.emitted('close-drawer')).toBeUndefined();
findDrawer().vm.$emit('close');
expect(wrapper.emitted('close-drawer')).toHaveLength(1);
});
});