summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_blocked_spec.js
blob: 9b10b078e89edd1a7cb133c33f9d7b3e209baff5 (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
import { shallowMount, mount } from '@vue/test-utils';
import PipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';

describe('MRWidgetPipelineBlocked', () => {
  let wrapper;

  const createWrapper = (mountFn = shallowMount) => {
    wrapper = mountFn(PipelineBlockedComponent);
  };

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

  it('renders warning icon', () => {
    createWrapper(mount);

    expect(wrapper.find('.ci-status-icon-warning').exists()).toBe(true);
  });

  it('renders information text', () => {
    createWrapper();

    expect(wrapper.text()).toBe(
      "Merge blocked: pipeline must succeed. It's waiting for a manual action to continue.",
    );
  });
});