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
816 B

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