Breadcrumbs.spec.js 992 B

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue'
  2. import { shallowMount, mount } from '@vue/test-utils'
  3. import CoreuiVue from '@coreui/vue'
  4. import Breadcrumbs from '@/views/base/Breadcrumbs'
  5. Vue.use(CoreuiVue)
  6. describe('Breadcrumbs.vue', () => {
  7. it('has a name', () => {
  8. expect(Breadcrumbs.name).toBe('Breadcrumbs')
  9. })
  10. it('has a created hook', () => {
  11. expect(typeof Breadcrumbs.data).toMatch('function')
  12. })
  13. it('sets the correct default data', () => {
  14. expect(typeof Breadcrumbs.data).toMatch('function')
  15. const defaultData = Breadcrumbs.data()
  16. expect(typeof defaultData.items).toMatch('object')
  17. })
  18. it('is Vue instance', () => {
  19. const wrapper = shallowMount(Breadcrumbs)
  20. expect(wrapper.vm).toBeTruthy()
  21. })
  22. it('is Breadcrumbs', () => {
  23. const wrapper = shallowMount(Breadcrumbs)
  24. expect(wrapper.findComponent(Breadcrumbs)).toBeTruthy()
  25. })
  26. test('renders correctly', () => {
  27. const wrapper = mount(Breadcrumbs)
  28. expect(wrapper.element).toMatchSnapshot()
  29. })
  30. })