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