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

issue_placeholder_system_note_spec.js « components « notes « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d508a49f710f5b846159aa11fff4eca1a8339fb1 (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
import Vue from 'vue';
import placeholderSystemNote from '~/notes/components/issue_placeholder_system_note.vue';

describe('issue placeholder system note component', () => {
  let mountComponent;
  beforeEach(() => {
    const PlaceholderSystemNote = Vue.extend(placeholderSystemNote);

    mountComponent = props => new PlaceholderSystemNote({
      propsData: {
        note: {
          body: props,
        },
      },
    }).$mount();
  });

  it('should render system note placeholder with plain text', () => {
    const vm = mountComponent('This is a placeholder');

    expect(vm.$el.tagName).toEqual('LI');
    expect(vm.$el.querySelector('.timeline-content em').textContent.trim()).toEqual('This is a placeholder');
  });
});