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

walkthrough_popover_spec.js « popovers « components « pipeline_editor « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8d172a8462a204a1382362e5f1ac6df3271cc005 (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
import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import WalkthroughPopover from '~/pipeline_editor/components/popovers/walkthrough_popover.vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';

Vue.config.ignoredElements = ['gl-emoji'];

describe('WalkthroughPopover component', () => {
  let wrapper;

  const createComponent = (mountFn = shallowMount) => {
    return extendedWrapper(mountFn(WalkthroughPopover));
  };

  afterEach(() => {
    wrapper.destroy();
  });

  describe('CTA button clicked', () => {
    beforeEach(async () => {
      wrapper = createComponent(mount);
      await wrapper.findByTestId('ctaBtn').trigger('click');
    });

    it('emits "walkthrough-popover-cta-clicked" event', async () => {
      expect(wrapper.emitted()['walkthrough-popover-cta-clicked']).toBeTruthy();
    });
  });
});