blob: 2845f76209b9e673b83120b561f8556891b3d4bf (
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
|
import { shallowMount } from '@vue/test-utils';
import { GlDrawer } from '@gitlab/ui';
import PipelineEditorDrawer from '~/ci/pipeline_editor/components/drawer/pipeline_editor_drawer.vue';
import { EDITOR_APP_DRAWER_NONE } from '~/ci/pipeline_editor/constants';
describe('Pipeline editor drawer', () => {
let wrapper;
const findDrawer = () => wrapper.findComponent(GlDrawer);
const createComponent = () => {
wrapper = shallowMount(PipelineEditorDrawer);
};
it('emits close event when closing the drawer', () => {
createComponent();
expect(wrapper.emitted('switch-drawer')).toBeUndefined();
findDrawer().vm.$emit('close');
expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_NONE]]);
});
});
|