2020-01-23 13:08:53 -05:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
|
|
|
import CodeBlock from '~/vue_shared/components/code_block.vue';
|
2018-07-31 11:50:34 -04:00
|
|
|
|
|
|
|
describe('Code Block', () => {
|
2020-01-23 13:08:53 -05:00
|
|
|
let wrapper;
|
2018-07-31 11:50:34 -04:00
|
|
|
|
2020-01-23 13:08:53 -05:00
|
|
|
const createComponent = () => {
|
|
|
|
wrapper = shallowMount(CodeBlock, {
|
|
|
|
propsData: {
|
|
|
|
code: 'test-code',
|
|
|
|
},
|
2018-07-31 11:50:34 -04:00
|
|
|
});
|
2020-01-23 13:08:53 -05:00
|
|
|
};
|
2018-07-31 11:50:34 -04:00
|
|
|
|
2020-01-23 13:08:53 -05:00
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
wrapper = null;
|
2018-07-31 11:50:34 -04:00
|
|
|
});
|
|
|
|
|
2020-01-23 13:08:53 -05:00
|
|
|
it('matches snapshot', () => {
|
|
|
|
createComponent();
|
2018-07-31 11:50:34 -04:00
|
|
|
|
2020-01-23 13:08:53 -05:00
|
|
|
expect(wrapper.element).toMatchSnapshot();
|
2018-07-31 11:50:34 -04:00
|
|
|
});
|
|
|
|
});
|