summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_shared/components/notes/placeholder_system_note_spec.js
blob: 6013e85811aa6fb92aa7970afbe7bb4ac39309e3 (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
import Vue from 'vue';
import placeholderSystemNote from '~/vue_shared/components/notes/placeholder_system_note.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';

describe('placeholder system note component', () => {
  let PlaceholderSystemNote;
  let vm;

  beforeEach(() => {
    PlaceholderSystemNote = Vue.extend(placeholderSystemNote);
  });

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

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

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