1import { mount } from '@vue/test-utils'; 2import PageTitle from '@/components/Global/PageTitle'; 3 4describe('PageTitle.vue', () => { 5 const wrapper = mount(PageTitle, { 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}); 31