Files
manja_dev_ui/tests/unit/Widgets.spec.js
T
2018-08-21 15:08:10 +02:00

29 lines
807 B
JavaScript

import Vue from 'vue'
import { shallowMount } from '@vue/test-utils'
import BootstrapVue from 'bootstrap-vue'
import Widgets from '@/views/Widgets'
Vue.use(BootstrapVue)
describe('Widgets.vue', () => {
it('has a name', () => {
expect(Widgets.name).toMatch('widgets')
})
it('has a created hook', () => {
expect(typeof Widgets.data).toMatch('function')
})
it('sets the correct default data', () => {
expect(typeof Widgets.data).toMatch('function')
const defaultData = Widgets.data()
expect(defaultData.msg).toMatch('Widgets')
})
it('is Vue instance', () => {
const wrapper = shallowMount(Widgets)
expect(wrapper.isVueInstance()).toBe(true)
})
it('is Widgets', () => {
const wrapper = shallowMount(Widgets)
expect(wrapper.is(Widgets)).toBe(true)
})
})