summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_shared/components/blob_viewers/rich_viewer_spec.js
blob: 17ea78b5826c048b1f3204878eef66b606fa09fb (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 { shallowMount } from '@vue/test-utils';
import RichViewer from '~/vue_shared/components/blob_viewers/rich_viewer.vue';

describe('Blob Rich Viewer component', () => {
  let wrapper;
  const content = '<h1 id="markdown">Foo Bar</h1>';

  function createComponent() {
    wrapper = shallowMount(RichViewer, {
      propsData: {
        content,
      },
    });
  }

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

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

  it('renders the passed content without transformations', () => {
    expect(wrapper.html()).toContain(content);
  });
});