summaryrefslogtreecommitdiff
path: root/spec/frontend/pipeline_editor/components/drawer/ui/pipeline_visual_reference_spec.js
blob: e48345444846129717147f9fef20028e26fd3775 (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
import { shallowMount } from '@vue/test-utils';
import DemoJobPill from '~/pipeline_editor/components/drawer/ui/demo_job_pill.vue';
import PipelineVisualReference from '~/pipeline_editor/components/drawer/ui/pipeline_visual_reference.vue';

describe('Demo job pill', () => {
  let wrapper;

  const createComponent = () => {
    wrapper = shallowMount(PipelineVisualReference);
  };

  const findAllDemoJobPills = () => wrapper.findAllComponents(DemoJobPill);

  beforeEach(() => {
    createComponent();
  });

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

  it('renders all stage names', () => {
    expect(wrapper.text()).toContain(wrapper.vm.$options.i18n.stageNames.build);
    expect(wrapper.text()).toContain(wrapper.vm.$options.i18n.stageNames.test);
    expect(wrapper.text()).toContain(wrapper.vm.$options.i18n.stageNames.deploy);
  });

  it('renders all job pills', () => {
    expect(findAllDemoJobPills()).toHaveLength(4);
  });
});