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
+32
View File
@@ -0,0 +1,32 @@
import Vue from 'vue'
import { mount } from '@vue/test-utils'
import BootstrapVue from 'bootstrap-vue'
import Popovers from '@/views/base/Popovers'
Vue.use(BootstrapVue)
describe('Popovers.vue', () => {
it('has a name', () => {
expect(Popovers.name).toMatch('popovers')
})
it('has a created hook', () => {
expect(typeof Popovers.data).toMatch('function')
})
it('sets the correct default data', () => {
expect(typeof Popovers.data).toMatch('function')
const defaultData = Popovers.data()
expect(defaultData.show).toBe(false)
})
it('is Vue instance', () => {
const wrapper = mount(Popovers)
expect(wrapper.isVueInstance()).toBe(true)
})
it('is Popovers', () => {
const wrapper = mount(Popovers)
expect(wrapper.is(Popovers)).toBe(true)
})
it('should render correct content', () => {
const wrapper = mount(Popovers)
expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Popovers')
})
})