Sukanya Pandey | e669304 | 2020-12-02 19:30:45 +0530 | [diff] [blame] | 1 | import { mount, createLocalVue } from '@vue/test-utils'; |
| 2 | import PageTitle from '@/components/Global/PageTitle'; |
| 3 | |
| 4 | const localVue = createLocalVue(); |
| 5 | |
| 6 | describe('PageTitle.vue', () => { |
| 7 | const wrapper = mount(PageTitle, { |
| 8 | localVue, |
| 9 | propsData: { |
| 10 | description: 'A page title test description', |
| 11 | }, |
| 12 | mocks: { |
| 13 | $t: (key) => key, |
| 14 | $route: { |
| 15 | meta: { |
| 16 | title: 'Page Title', |
| 17 | }, |
| 18 | }, |
| 19 | }, |
| 20 | }); |
| 21 | it('should exist', () => { |
| 22 | expect(wrapper.exists()).toBe(true); |
| 23 | }); |
| 24 | it('should render h1 element', () => { |
| 25 | expect(wrapper.find('h1').exists()).toBe(true); |
| 26 | }); |
| 27 | it('should render p element', () => { |
| 28 | expect(wrapper.find('p').exists()).toBe(true); |
| 29 | }); |
| 30 | it('should render correctly', () => { |
| 31 | expect(wrapper.element).toMatchSnapshot(); |
| 32 | }); |
| 33 | }); |