tests: add some issing tests
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import Vue from 'vue'
|
||||
import { shallowMount, mount } from '@vue/test-utils'
|
||||
import BootstrapVue from 'bootstrap-vue'
|
||||
import Forms from '@/views/base/Forms'
|
||||
|
||||
Vue.use(BootstrapVue)
|
||||
|
||||
describe('Forms.vue', () => {
|
||||
it('has a name', () => {
|
||||
expect(Forms.name).toMatch('forms')
|
||||
})
|
||||
it('has a created hook', () => {
|
||||
expect(typeof Forms.data).toMatch('function')
|
||||
})
|
||||
it('sets the correct default data', () => {
|
||||
expect(typeof Forms.data).toMatch('function')
|
||||
const defaultData = Forms.data()
|
||||
expect(defaultData.show).toBe(true)
|
||||
})
|
||||
it('is Vue instance', () => {
|
||||
const wrapper = shallowMount(Forms)
|
||||
expect(wrapper.isVueInstance()).toBe(true)
|
||||
})
|
||||
it('is Forms', () => {
|
||||
const wrapper = shallowMount(Forms)
|
||||
expect(wrapper.is(Forms)).toBe(true)
|
||||
})
|
||||
it('should render correct content', () => {
|
||||
const wrapper = mount(Forms)
|
||||
expect(wrapper.find('div.card-header > div > strong').text()).toMatch('Credit Card')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user