2020-10-11 11:41:32 +03:00
|
|
|
import Formulario from '@/index.ts'
|
2020-05-22 14:22:16 +03:00
|
|
|
|
|
|
|
describe('Formulario', () => {
|
2020-10-22 10:47:53 +03:00
|
|
|
it('Installs on vue instance', () => {
|
2020-05-22 14:22:16 +03:00
|
|
|
const registry = []
|
|
|
|
function Vue () {}
|
|
|
|
Vue.component = function (name, instance) {
|
|
|
|
registry.push(name)
|
|
|
|
}
|
2020-10-10 22:45:28 +03:00
|
|
|
Formulario.install(Vue)
|
2020-05-22 14:22:16 +03:00
|
|
|
expect(Vue.prototype.$formulario).toBe(Formulario)
|
2020-10-22 16:37:57 +03:00
|
|
|
expect(registry).toEqual([
|
|
|
|
'FormularioForm',
|
|
|
|
'FormularioGrouping',
|
|
|
|
'FormularioInput',
|
|
|
|
])
|
2020-05-22 14:22:16 +03:00
|
|
|
})
|
|
|
|
})
|