Modals.spec.js 928 B

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