summaryrefslogtreecommitdiff
path: root/tests/unit/Global/PageTitle.spec.js
blob: 933212ca14feae8344760bcd3ff1f2b8ffd3779d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { mount } from '@vue/test-utils';
import PageTitle from '@/components/Global/PageTitle';

describe('PageTitle.vue', () => {
  const wrapper = mount(PageTitle, {
    propsData: {
      description: 'A page title test description',
    },
    mocks: {
      $t: (key) => key,
      $route: {
        meta: {
          title: 'Page Title',
        },
      },
    },
  });
  it('should exist', () => {
    expect(wrapper.exists()).toBe(true);
  });
  it('should render h1 element', () => {
    expect(wrapper.find('h1').exists()).toBe(true);
  });
  it('should render p element', () => {
    expect(wrapper.find('p').exists()).toBe(true);
  });
  it('should render correctly', () => {
    expect(wrapper.element).toMatchSnapshot();
  });
});