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 1
1
import { createLocalVue , enableAutoDestroy } from '@vue/test-utils'
2
- import { vfmPlugin } from '../../lib'
2
+ import VueFinalModal , { vfmPlugin } from '../../lib'
3
3
4
4
enableAutoDestroy ( afterEach )
5
5
6
6
describe ( '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
+ } )
7
27
it ( 'window is undefined in node server' , ( ) => {
8
28
Object . defineProperty ( global , 'window' , { value : undefined } )
9
29
global . console . error = jest . fn ( )
You can’t perform that action at this time.
0 commit comments