added unit tests to widgets

This commit is contained in:
woothu
2018-10-09 13:33:43 +02:00
parent b318110c7d
commit 4741d4231a
14 changed files with 233 additions and 71 deletions
+21
View File
@@ -0,0 +1,21 @@
import Vue from 'vue'
import { shallowMount } from '@vue/test-utils'
import BootstrapVue from 'bootstrap-vue'
import Component from '@/views/PATH'
Vue.use(BootstrapVue)
const ComponentName = 'COMPONENT_NAME'
const wrapper = shallowMount(Component)
describe(ComponentName + '.vue', () => {
it('has a name', () => {
expect(Component.name).toMatch(ComponentName)
})
it('is Vue instance', () => {
expect(wrapper.isVueInstance()).toBe(true)
})
it('has a created hook', () => {
expect(typeof Component.data).toMatch('function')
})
})