summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked_spec.js
blob: c0197b5e20aad8040f72c965140398c2bfd36554 (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
import { shallowMount } from '@vue/test-utils';
import PipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
import StatusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
import BoldText from '~/vue_merge_request_widget/components/bold_text.vue';

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

  beforeEach(() => {
    wrapper = shallowMount(PipelineBlockedComponent);
  });

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

  it('renders error icon', () => {
    expect(wrapper.findComponent(StatusIcon).exists()).toBe(true);
    expect(wrapper.findComponent(StatusIcon).props().status).toBe('failed');
  });

  it('renders information text', () => {
    const message = wrapper.findComponent(BoldText).props('message');
    expect(message).toContain('Merge blocked:');
    expect(message).toContain(
      "pipeline must succeed. It's waiting for a manual action to continue.",
    );
  });
});