summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_mr_widget/components/states/mr_widget_pipeline_blocked_spec.js
blob: ab096a56918378c78e2b309b4a64ef1176941999 (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
import Vue from 'vue';
import pipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { removeBreakLine } from 'spec/helpers/vue_component_helper';

describe('MRWidgetPipelineBlocked', () => {
  let vm;
  beforeEach(() => {
    const Component = Vue.extend(pipelineBlockedComponent);
    vm = mountComponent(Component);
  });

  afterEach(() => {
    vm.$destroy();
  });

  it('renders warning icon', () => {
    expect(vm.$el.querySelector('.ci-status-icon-warning')).not.toBe(null);
  });

  it('renders information text', () => {
    expect(
      removeBreakLine(vm.$el.textContent).trim(),
    ).toContain('Pipeline blocked. The pipeline for this merge request requires a manual action to proceed');
  });
});