summaryrefslogtreecommitdiff
path: root/spec/javascripts/issue_show/components/fields/description_spec.js
blob: d13362ef8e6d64c3f75fe23802441ca544903fb4 (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
32
33
34
import Vue from 'vue';
import Store from '~/issue_show/stores';
import descriptionField from '~/issue_show/components/fields/description.vue';

describe('Description field component', () => {
  let vm;
  let store;

  beforeEach((done) => {
    const Component = Vue.extend(descriptionField);
    store = new Store({
      titleHtml: '',
      descriptionHtml: '',
      issuableRef: '',
    });
    store.formState.description = 'test';

    vm = new Component({
      propsData: {
        markdownPreviewUrl: '/',
        markdownDocs: '/',
        store,
      },
    }).$mount();

    Vue.nextTick(done);
  });

  it('renders markdown field with description', () => {
    expect(
      vm.$el.querySelector('.md-area textarea').value,
    ).toBe('test');
  });
});