Tooltips.spec.js 972 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Vue from 'vue'
  2. import { shallowMount } from '@vue/test-utils';
  3. import CoreuiVue from '@coreui/vue'
  4. import Tooltips from '@/views/base/Tooltips'
  5. Vue.use(CoreuiVue)
  6. describe('Tooltips.vue', () => {
  7. it('has a name', () => {
  8. expect(Tooltips.name).toBe('Tooltips')
  9. })
  10. it('has a created hook', () => {
  11. expect(typeof Tooltips.data).toMatch('function')
  12. })
  13. it('is Vue instance', () => {
  14. const wrapper = shallowMount(Tooltips)
  15. expect(wrapper.vm).toBeTruthy()
  16. })
  17. it('is Tooltips', () => {
  18. const wrapper = shallowMount(Tooltips)
  19. expect(wrapper.findComponent(Tooltips)).toBeTruthy()
  20. })
  21. // test('renders correctly', () => {
  22. // const wrapper = shallowMount(Tooltips)
  23. // expect(wrapper.element).toMatchSnapshot()
  24. // })
  25. })
  26. if (global.document) {
  27. document.createRange = () => ({
  28. setStart: () => {},
  29. setEnd: () => {},
  30. commonAncestorContainer: {
  31. nodeName: 'BODY',
  32. ownerDocument: document,
  33. },
  34. });
  35. }