mr_widget_pipeline_blocked_spec.js 772 字节
Newer Older
F
Fatih Acet 已提交
1
import Vue from 'vue';
2
import pipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
3
import mountComponent from 'spec/helpers/vue_mount_component_helper';
F
Fatih Acet 已提交
4 5

describe('MRWidgetPipelineBlocked', () => {
6 7
  let vm;
  beforeEach(() => {
F
Fatih Acet 已提交
8
    const Component = Vue.extend(pipelineBlockedComponent);
9 10 11 12 13 14 15 16 17 18 19 20 21
    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(vm.$el.textContent.trim().replace(/[\r\n]+/g, ' ')).toContain('Pipeline blocked. The pipeline for this merge request requires a manual action to proceed');
F
Fatih Acet 已提交
22 23
  });
});