Switches.spec.js 748 B

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