mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test global components
This commit is contained in:
parent
e8859544f7
commit
259a663f05
29
frontend/src/plugins/globalComponents.test.js
Normal file
29
frontend/src/plugins/globalComponents.test.js
Normal file
@ -0,0 +1,29 @@
|
||||
import GlobalComponents from './globalComponents.js'
|
||||
import Vue from 'vue'
|
||||
import 'vee-validate'
|
||||
|
||||
jest.mock('vue')
|
||||
jest.mock('vee-validate', () => {
|
||||
const originalModule = jest.requireActual('vee-validate')
|
||||
return {
|
||||
__esModule: true,
|
||||
...originalModule,
|
||||
ValidationProvider: 'mocked validation provider',
|
||||
ValidationObserver: 'mocked validation observer',
|
||||
}
|
||||
})
|
||||
|
||||
const vueComponentMock = jest.fn()
|
||||
Vue.component = vueComponentMock
|
||||
|
||||
describe('global Components', () => {
|
||||
GlobalComponents.install(Vue)
|
||||
|
||||
it('installs the validation provider', () => {
|
||||
expect(vueComponentMock).toBeCalledWith('validation-provider', 'mocked validation provider')
|
||||
})
|
||||
|
||||
it('installs the validation observer', () => {
|
||||
expect(vueComponentMock).toBeCalledWith('validation-observer', 'mocked validation observer')
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user