test: added basic unit tests (except for charts). Unit tests segregated in directories.

This commit is contained in:
woothu
2018-10-12 10:01:54 +02:00
parent 364c951ef2
commit ceee8b07ca
45 changed files with 70 additions and 2 deletions
@@ -0,0 +1,31 @@
import BootstrapVue from 'bootstrap-vue'
import { shallowMount, createLocalVue } from '@vue/test-utils'
import VueRouter from 'vue-router'
import DefaultContainer from '@/containers/DefaultContainer'
const localVue = createLocalVue()
localVue.use(VueRouter)
const router = new VueRouter()
localVue.use(BootstrapVue)
describe('DefaultContainer.vue', () => {
it('has a name', () => {
expect(DefaultContainer.name).toMatch('full')
})
it('has a created hook', () => {
expect(typeof DefaultContainer.data).toMatch('function')
})
it('sets the correct default data', () => {
expect(typeof DefaultContainer.data).toMatch('function')
const defaultData = DefaultContainer.data()
expect(typeof defaultData.nav).toMatch('object')
})
it('is Vue instance', () => {
const wrapper = shallowMount(DefaultContainer, {
localVue,
router
})
expect(wrapper.isVueInstance()).toBe(true)
})
})