summaryrefslogtreecommitdiff
path: root/spec/frontend/snippets/components/snippet_description_view_spec.js
blob: 46467ef311eaf5a23d3a67c4f3f43df389d8d748 (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 SnippetDescription from '~/snippets/components/snippet_description_view.vue';
import { shallowMount } from '@vue/test-utils';

describe('Snippet Description component', () => {
  let wrapper;
  const description = '<h2>The property of Thor</h2>';

  function createComponent() {
    wrapper = shallowMount(SnippetDescription, {
      propsData: {
        description,
      },
    });
  }

  beforeEach(() => {
    createComponent();
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('matches the snapshot', () => {
    expect(wrapper.element).toMatchSnapshot();
  });
});