debian-mirror-gitlab/spec/frontend/vue_shared/components/code_block_spec.js

26 lines
487 B
JavaScript
Raw Normal View History

2020-03-09 13:42:32 +05:30
import { shallowMount } from '@vue/test-utils';
import CodeBlock from '~/vue_shared/components/code_block.vue';
2018-11-18 11:00:15 +05:30
describe('Code Block', () => {
2020-03-09 13:42:32 +05:30
let wrapper;
2018-11-18 11:00:15 +05:30
2020-03-09 13:42:32 +05:30
const createComponent = () => {
wrapper = shallowMount(CodeBlock, {
propsData: {
code: 'test-code',
},
2018-11-18 11:00:15 +05:30
});
2020-03-09 13:42:32 +05:30
};
2018-11-18 11:00:15 +05:30
2020-03-09 13:42:32 +05:30
afterEach(() => {
wrapper.destroy();
wrapper = null;
2018-11-18 11:00:15 +05:30
});
2020-03-09 13:42:32 +05:30
it('matches snapshot', () => {
createComponent();
2018-11-18 11:00:15 +05:30
2020-03-09 13:42:32 +05:30
expect(wrapper.element).toMatchSnapshot();
2018-11-18 11:00:15 +05:30
});
});