TheSidebar.spec.js 630 B

12345678910111213141516171819202122232425
  1. import { shallowMount, createLocalVue } from '@vue/test-utils';
  2. import CoreuiVue from '@coreui/vue'
  3. import Vuex from 'vuex'
  4. import TheSidebar from '@/containers/TheSidebar'
  5. const localVue = createLocalVue()
  6. localVue.use(CoreuiVue)
  7. localVue.use(Vuex)
  8. const store = new Vuex.Store({
  9. state: {
  10. sidebarShow: 'responsive',
  11. sidebarMinimize: false
  12. }
  13. })
  14. describe('TheSidebar.vue', () => {
  15. it('has a name', () => {
  16. expect(TheSidebar.name).toBe('TheSidebar')
  17. })
  18. test('renders correctly', () => {
  19. const wrapper = shallowMount(TheSidebar, { store, localVue })
  20. expect(wrapper.element).toMatchSnapshot()
  21. })
  22. })