@@ -179,7 +179,7 @@ describe('VueFinalModal.vue', () => {
179
179
expect ( wrapper . find ( '.vfm' ) . classes ( 'vfm--prevent-none' ) ) . toBe ( true )
180
180
expect ( wrapper . find ( '.vfm__content' ) . classes ( 'vfm--prevent-auto' ) ) . toBe ( true )
181
181
} )
182
- it ( 'attach: body ' , async ( ) => {
182
+ it ( 'attach: HTMLElement ' , async ( ) => {
183
183
const elem = document . createElement ( 'div' )
184
184
document . body . appendChild ( elem )
185
185
const { wrapper } = await createOpenedModal ( {
@@ -199,5 +199,27 @@ describe('VueFinalModal.vue', () => {
199
199
} )
200
200
expect ( document . activeElement === wrapper . find ( '.vfm__container' ) . vm . $el ) . toBe ( true )
201
201
} )
202
+ it ( 'zIndexAuto' , async ( ) => {
203
+ const { wrapper } = await createOpenedModal ( {
204
+ zIndexAuto : false
205
+ } )
206
+ expect ( wrapper . attributes ( 'style' ) ) . not . toContain ( 'z-index' )
207
+ } )
208
+ it ( 'zIndexBase' , async ( ) => {
209
+ const zIndexBase = 2000
210
+ const zIndexStyle = `z-index: ${ zIndexBase } ;`
211
+ const { wrapper } = await createOpenedModal ( {
212
+ zIndexBase : zIndexBase
213
+ } )
214
+ expect ( wrapper . attributes ( 'style' ) ) . toContain ( zIndexStyle )
215
+ } )
216
+ it ( 'zIndex' , async ( ) => {
217
+ const zIndex = 3000
218
+ const zIndexStyle = `z-index: ${ zIndex } ;`
219
+ const { wrapper } = await createOpenedModal ( {
220
+ zIndex
221
+ } )
222
+ expect ( wrapper . attributes ( 'style' ) ) . toContain ( zIndexStyle )
223
+ } )
202
224
} )
203
225
} )
0 commit comments