summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js
blob: f7523a019635daa62ff9207d0e5105d21a64d49a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Vue from 'vue';
import PipelineFailed from '~/vue_merge_request_widget/components/states/pipeline_failed.vue';
import { removeBreakLine } from 'spec/helpers/vue_component_helper';

describe('PipelineFailed', () => {
  describe('template', () => {
    const Component = Vue.extend(PipelineFailed);
    const vm = new Component({
      el: document.createElement('div'),
    });
    it('should have correct elements', () => {
      expect(vm.$el.classList.contains('mr-widget-body')).toBeTruthy();
      expect(vm.$el.querySelector('button').getAttribute('disabled')).toBeTruthy();
      expect(removeBreakLine(vm.$el.innerText).trim()).toContain(
        'The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure',
      );
    });
  });
});