mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-22 17:00:32 +03:00
Add sample unit test
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import Vue from 'vue'
|
||||
import VueFormWizard from './../../../src/components/FormWizard.vue'
|
||||
import TabContent from './../../../src/components/TabContent.vue'
|
||||
|
||||
function init () {
|
||||
Vue.component('form-wizard', VueFormWizard)
|
||||
Vue.component('tab-content', TabContent)
|
||||
}
|
||||
|
||||
describe('FormWizard.vue', () => {
|
||||
beforeEach(() => {
|
||||
init()
|
||||
})
|
||||
it('should render correct contents', (done) => {
|
||||
const vm = new Vue({
|
||||
template: `<form-wizard ref="wizard">
|
||||
<tab-content>First</tab-content>
|
||||
<tab-content>Second</tab-content>
|
||||
</form-wizard>`
|
||||
}).$mount()
|
||||
|
||||
let wizard = vm.$children[0]
|
||||
let wizardComp = vm.$refs.wizard
|
||||
expect(wizard.$children.length).to.equal(2)
|
||||
expect(wizardComp.activeTabIndex).to.equal(0)
|
||||
done()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user