test: added basic unit tests (except for charts). Unit tests segregated in directories.
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { shallowMount, mount } from '@vue/test-utils'
|
||||||
|
import BootstrapVue from 'bootstrap-vue'
|
||||||
|
import Component from '@/views/theme/ColorTheme'
|
||||||
|
|
||||||
|
Vue.use(BootstrapVue)
|
||||||
|
const ComponentName = 'ColorTheme'
|
||||||
|
|
||||||
|
describe(ComponentName + '.vue', () => {
|
||||||
|
it('has a name', () => {
|
||||||
|
expect(Component.name).toMatch(ComponentName)
|
||||||
|
})
|
||||||
|
it('is Vue instance', () => {
|
||||||
|
const wrapper = shallowMount(Component)
|
||||||
|
expect(wrapper.isVueInstance()).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { shallowMount, mount } from '@vue/test-utils'
|
||||||
|
import BootstrapVue from 'bootstrap-vue'
|
||||||
|
import Component from '@/views/theme/ColorView'
|
||||||
|
|
||||||
|
Vue.use(BootstrapVue)
|
||||||
|
const ComponentName = 'ColorView'
|
||||||
|
|
||||||
|
describe(ComponentName + '.vue', () => {
|
||||||
|
it('has a name', () => {
|
||||||
|
expect(Component.name).toMatch(ComponentName)
|
||||||
|
})
|
||||||
|
it('is Vue instance', () => {
|
||||||
|
const wrapper = shallowMount(Component)
|
||||||
|
expect(wrapper.isVueInstance()).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -19,7 +19,5 @@ describe(ComponentName + '.vue', () => {
|
|||||||
expect(wrapper.props().cardClasses).toBe('')
|
expect(wrapper.props().cardClasses).toBe('')
|
||||||
expect(wrapper.props().header).toBe('header:string')
|
expect(wrapper.props().header).toBe('header:string')
|
||||||
expect(wrapper.props().text).toBe('text:string')
|
expect(wrapper.props().text).toBe('text:string')
|
||||||
expect(wrapper.props().chartType).toBe('chart1')
|
|
||||||
expect(wrapper.props().chartHeight == 70).toBe(true)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { shallowMount } from '@vue/test-utils'
|
||||||
|
import BootstrapVue from 'bootstrap-vue'
|
||||||
|
import Component from '@/views/widgets/Widget07'
|
||||||
|
|
||||||
|
Vue.use(BootstrapVue)
|
||||||
|
|
||||||
|
const ComponentName = 'Widget07'
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { shallowMount } from '@vue/test-utils'
|
||||||
|
import BootstrapVue from 'bootstrap-vue'
|
||||||
|
import Component from '@/views/widgets/Widget08'
|
||||||
|
|
||||||
|
Vue.use(BootstrapVue)
|
||||||
|
|
||||||
|
const ComponentName = 'Widget08'
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user