summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_mr_widget/components/states/mr_widget_not_allowed_spec.js
blob: 61e00f4cf79c4a940a4c6bef343cf24302dbebbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import Vue from 'vue';
import notAllowedComponent from '~/vue_merge_request_widget/components/states/mr_widget_not_allowed';

describe('MRWidgetNotAllowed', () => {
  describe('template', () => {
    const Component = Vue.extend(notAllowedComponent);
    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(vm.$el.innerText).toContain('Ready to be merged automatically.');
      expect(vm.$el.innerText).toContain('Ask someone with write access to this repository to merge this request.');
    });
  });
});