test: restore and fix unit tests

This commit is contained in:
woothu
2019-08-10 12:07:10 +02:00
parent f9a4949b56
commit 704e04f9f6
89 changed files with 55790 additions and 6 deletions
@@ -0,0 +1,28 @@
import Vue from 'vue'
import { shallowMount, mount } from '@vue/test-utils'
import CoreuiVue from '@coreui/vue'
import BrandButtons from '@/views/buttons/BrandButtons'
import { CIconPlugin } from '@coreui/icons/vue'
import { iconsSet } from '@/assets/icons/icons.js'
Vue.use(CIconPlugin, iconsSet)
Vue.use(CoreuiVue)
describe('BrandButtons.vue', () => {
it('has a name', () => {
expect(BrandButtons.name).toMatch('brand-buttons')
})
it('is Vue instance', () => {
const wrapper = shallowMount(BrandButtons)
expect(wrapper.isVueInstance()).toBe(true)
})
it('is BrandButtons', () => {
const wrapper = shallowMount(BrandButtons)
expect(wrapper.is(BrandButtons)).toBe(true)
})
test('renders correctly', () => {
const wrapper = mount(BrandButtons)
expect(wrapper.element).toMatchSnapshot()
})
})