Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pipeline_editor_drawer_spec.js « drawer « components « pipeline_editor « ci « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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]]);
  });
});