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
895 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 ProjectDeletionButton from '@/components/containers/ProjectDeletionButton'
  6. const localVue = createLocalVue()
  7. localVue.use(Vuex)
  8. Vue.use(Vuetify)
  9. describe('ProjectDeletionButtonContainer', () => {
  10. let store
  11. let projects
  12. let actions
  13. let mutations
  14. beforeEach(() => {
  15. actions = {
  16. deleteProject: 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 deleteProject action', () => {
  32. const wrapper = shallowMount(ProjectDeletionButton, { store, localVue })
  33. wrapper.vm.handleDeleteProject()
  34. expect(actions.deleteProject).toHaveBeenCalled()
  35. })
  36. })