TheContainer.spec.js 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import CoreuiVue from '@coreui/vue'
  2. import { shallowMount, createLocalVue } from '@vue/test-utils';
  3. import VueRouter from 'vue-router'
  4. import Vuex from 'vuex'
  5. import TheContainer from '@/containers/TheContainer'
  6. const localVue = createLocalVue()
  7. localVue.use(Vuex)
  8. localVue.use(VueRouter)
  9. localVue.use(CoreuiVue)
  10. const store = new Vuex.Store({
  11. state: {
  12. darkMode: false,
  13. sidebarShow: 'responsive',
  14. sidebarMinimize: false,
  15. asideShow: false
  16. }
  17. })
  18. const router = new VueRouter()
  19. describe('TheContainer.vue', () => {
  20. it('has a name', () => {
  21. expect(TheContainer.name).toBe('TheContainer')
  22. })
  23. test('renders correctly', () => {
  24. const wrapper = shallowMount(TheContainer, {
  25. store,
  26. localVue,
  27. router
  28. })
  29. expect(wrapper.element).toMatchSnapshot()
  30. })
  31. it('is Vue instance', () => {
  32. const wrapper = shallowMount(TheContainer, {
  33. store,
  34. localVue,
  35. router
  36. })
  37. expect(wrapper.vm).toBeTruthy()
  38. })
  39. })