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

describe('MRWidgetArchived', () => {
  describe('template', () => {
    it('should have correct elements', () => {
      const Component = Vue.extend(archivedComponent);
      const el = new Component({
        el: document.createElement('div'),
      }).$el;

      expect(el.classList.contains('mr-widget-body')).toBeTruthy();
      expect(el.querySelector('button').classList.contains('btn-success')).toBeTruthy();
      expect(el.querySelector('button').disabled).toBeTruthy();
      expect(el.innerText).toContain('This project is archived, write access has been disabled.');
    });
  });
});