Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mr_widget_archived_spec.js « states « components « vue_mr_widget « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4bdc6c95f22e7b6b59dead308b63eb1b33764a4e (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
31
import Vue from 'vue';
import mountComponent from 'helpers/vue_mount_component_helper';
import archivedComponent from '~/vue_merge_request_widget/components/states/mr_widget_archived.vue';

describe('MRWidgetArchived', () => {
  let vm;

  beforeEach(() => {
    const Component = Vue.extend(archivedComponent);
    vm = mountComponent(Component);
  });

  afterEach(() => {
    vm.$destroy();
  });

  it('renders a ci status failed icon', () => {
    expect(vm.$el.querySelector('.ci-status-icon')).not.toBeNull();
  });

  it('renders a disabled button', () => {
    expect(vm.$el.querySelector('button').getAttribute('disabled')).toEqual('disabled');
    expect(vm.$el.querySelector('button').textContent.trim()).toEqual('Merge');
  });

  it('renders information', () => {
    expect(vm.$el.querySelector('.bold').textContent.trim()).toEqual(
      'This project is archived, write access has been disabled',
    );
  });
});