2020-05-07 15:09:29 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2020-08-17 21:09:56 +00:00
|
|
|
import SnippetDescription from '~/snippets/components/snippet_description_view.vue';
|
2020-05-07 15:09:29 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|