summaryrefslogtreecommitdiff
path: root/spec/frontend/pipeline_editor/components/header/pipeline_editor_header_spec.js
blob: df15a6c8e7fd222a8c065971a049389eb06272cb (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
32
33
34
import { shallowMount } from '@vue/test-utils';
import PipelineEditorHeader from '~/pipeline_editor/components/header/pipeline_editor_header.vue';
import ValidationSegment from '~/pipeline_editor/components/header/validation_segment.vue';

import { mockLintResponse } from '../../mock_data';

describe('Pipeline editor header', () => {
  let wrapper;

  const createComponent = () => {
    wrapper = shallowMount(PipelineEditorHeader, {
      props: {
        ciConfigData: mockLintResponse,
        isCiConfigDataLoading: false,
      },
    });
  };

  const findValidationSegment = () => wrapper.findComponent(ValidationSegment);

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

  describe('template', () => {
    beforeEach(() => {
      createComponent();
    });
    it('renders the validation segment', () => {
      expect(findValidationSegment().exists()).toBe(true);
    });
  });
});