diff options
-rw-r--r-- | tests/unit/Global/PageSection.spec.js | 25 | ||||
-rw-r--r-- | tests/unit/Global/__snapshots__/PageSection.spec.js.snap | 12 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/unit/Global/PageSection.spec.js b/tests/unit/Global/PageSection.spec.js new file mode 100644 index 00000000..a1b951b4 --- /dev/null +++ b/tests/unit/Global/PageSection.spec.js @@ -0,0 +1,25 @@ +import { mount, createLocalVue } from '@vue/test-utils'; +import PageSection from '@/components/Global/PageSection'; + +const localVue = createLocalVue(); + +describe('PageSection.vue', () => { + const wrapper = mount(PageSection, { + localVue, + propsData: { + sectionTitle: 'PageSection test title', + }, + mocks: { + $t: (key) => key, + }, + }); + it('should exist', () => { + expect(wrapper.exists()).toBe(true); + }); + it('should render h2 element', () => { + expect(wrapper.find('h2').exists()).toBe(true); + }); + it('should render correctly', () => { + expect(wrapper.element).toMatchSnapshot(); + }); +}); diff --git a/tests/unit/Global/__snapshots__/PageSection.spec.js.snap b/tests/unit/Global/__snapshots__/PageSection.spec.js.snap new file mode 100644 index 00000000..8e468b33 --- /dev/null +++ b/tests/unit/Global/__snapshots__/PageSection.spec.js.snap @@ -0,0 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PageSection.vue should render correctly 1`] = ` +<div + class="page-section" +> + <h2> + PageSection test title + </h2> + +</div> +`; |