mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
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
40 lines
895 B
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
|
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
import Vuetify from 'vuetify'
|
|
import ProjectDeletionButton from '@/components/containers/ProjectDeletionButton'
|
|
const localVue = createLocalVue()
|
|
localVue.use(Vuex)
|
|
Vue.use(Vuetify)
|
|
|
|
describe('ProjectDeletionButtonContainer', () => {
|
|
let store
|
|
let projects
|
|
let actions
|
|
let mutations
|
|
|
|
beforeEach(() => {
|
|
actions = {
|
|
deleteProject: jest.fn()
|
|
}
|
|
mutations = {}
|
|
projects = {
|
|
namespaced: true,
|
|
actions,
|
|
mutations,
|
|
state: {}
|
|
}
|
|
|
|
store = new Vuex.Store({
|
|
modules: {
|
|
projects
|
|
}
|
|
})
|
|
})
|
|
|
|
test('called deleteProject action', () => {
|
|
const wrapper = shallowMount(ProjectDeletionButton, { store, localVue })
|
|
wrapper.vm.handleDeleteProject()
|
|
expect(actions.deleteProject).toHaveBeenCalled()
|
|
})
|
|
})
|