File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 11import { createLocalVue , enableAutoDestroy } from '@vue/test-utils'
2- import { vfmPlugin } from '../../lib'
2+ import VueFinalModal , { vfmPlugin } from '../../lib'
33
44enableAutoDestroy ( afterEach )
55
66describe ( 'Plugin' , ( ) => {
7+ it ( 'globally register vue-final-modal' , ( ) => {
8+ const localVue = createLocalVue ( )
9+ localVue . use ( VueFinalModal ( ) )
10+ expect ( localVue . options . components ) . toHaveProperty ( 'VueFinalModal' )
11+ expect ( localVue . options . components ) . toHaveProperty ( 'ModalsContainer' )
12+ expect ( localVue . prototype ) . toHaveProperty ( '$vfm' )
13+ } )
14+ it ( 'globally register vue-final-modal by customized options' , ( ) => {
15+ const localVue = createLocalVue ( )
16+ localVue . use (
17+ VueFinalModal ( {
18+ key : '_$vfm' ,
19+ componentName : 'MyModal' ,
20+ dynamicContainerName : 'MyModalsContainer'
21+ } )
22+ )
23+ expect ( localVue . options . components ) . toHaveProperty ( 'MyModal' )
24+ expect ( localVue . options . components ) . toHaveProperty ( 'MyModalsContainer' )
25+ expect ( localVue . prototype ) . toHaveProperty ( '_$vfm' )
26+ } )
727 it ( 'window is undefined in node server' , ( ) => {
828 Object . defineProperty ( global , 'window' , { value : undefined } )
929 global . console . error = jest . fn ( )
You can’t perform that action at this time.
0 commit comments