You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
889 B

  1. import { shallowMount, createLocalVue } from '@vue/test-utils'
  2. import Vue from 'vue'
  3. import Vuex from 'vuex'
  4. import Vuetify from 'vuetify'
  5. import ProjectCreationButton from '@/components/containers/ProjectCreationButton'
  6. const localVue = createLocalVue()
  7. localVue.use(Vuex)
  8. Vue.use(Vuetify)
  9. describe('ProjectCreationButtonContainer', () => {
  10. let store
  11. let projects
  12. let actions
  13. let mutations
  14. beforeEach(() => {
  15. actions = {
  16. createProject: jest.fn()
  17. }
  18. mutations = {}
  19. projects = {
  20. namespaced: true,
  21. actions,
  22. mutations,
  23. state: {}
  24. }
  25. store = new Vuex.Store({
  26. modules: {
  27. projects
  28. }
  29. })
  30. })
  31. test('called createProject action', () => {
  32. const wrapper = shallowMount(ProjectCreationButton, { store, localVue })
  33. wrapper.vm.createProject()
  34. expect(actions.createProject).toHaveBeenCalled()
  35. })
  36. })