Tabs.spec.js 804 B

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