1
1
import { enableAutoUnmount , mount } from '@vue/test-utils'
2
2
import { afterEach , describe , expect , it } from 'vitest'
3
3
import BModal from './BModal.vue'
4
+ import BTransition from './BTransition/BTransition.vue'
4
5
5
- describe . skip ( 'modal' , ( ) => {
6
+ describe ( 'modal' , ( ) => {
6
7
enableAutoUnmount ( afterEach )
7
8
// Having issues getting the 'body' from the VDOM
8
9
it ( 'has body element' , ( ) => {
@@ -55,17 +56,6 @@ describe.skip('modal', () => {
55
56
expect ( $div . classes ( ) ) . toContain ( 'foo' )
56
57
} )
57
58
58
- it . skip ( 'div has class fade when not prop noFade' , async ( ) => {
59
- const wrapper = mount ( BModal , {
60
- global : { stubs : { teleport : true } } ,
61
- props : { noFade : false } ,
62
- } )
63
- const $div = wrapper . get ( 'div' )
64
- expect ( $div . classes ( ) ) . toContain ( 'fade' )
65
- await wrapper . setProps ( { noFade : true } )
66
- expect ( $div . classes ( ) ) . not . toContain ( 'fade' )
67
- } )
68
-
69
59
it ( 'div has class fade when not prop noFade' , ( ) => {
70
60
const wrapper = mount ( BModal , {
71
61
global : { stubs : { teleport : true } } ,
@@ -84,15 +74,6 @@ describe.skip('modal', () => {
84
74
expect ( $div . classes ( ) ) . not . toContain ( 'fade' )
85
75
} )
86
76
87
- it ( 'div has class show when not prop show' , ( ) => {
88
- const wrapper = mount ( BModal , {
89
- global : { stubs : { teleport : true } } ,
90
- props : { show : true } ,
91
- } )
92
- const $div = wrapper . get ( 'div' )
93
- expect ( $div . classes ( ) ) . toContain ( 'show' )
94
- } )
95
-
96
77
it ( 'div has class show when prop show' , ( ) => {
97
78
const wrapper = mount ( BModal , {
98
79
global : { stubs : { teleport : true } } ,
@@ -289,17 +270,6 @@ describe.skip('modal', () => {
289
270
expect ( $div3 . classes ( ) ) . toContain ( 'foo' )
290
271
} )
291
272
292
- it ( 'second div has does not have nested div when prop lazy' , ( ) => {
293
- const wrapper = mount ( BModal , {
294
- global : { stubs : { teleport : true } } ,
295
- props : { lazy : true } ,
296
- } )
297
- const $div = wrapper . get ( 'div' )
298
- const $div2 = $div . get ( 'div' )
299
- const $div3 = $div2 . find ( 'div' )
300
- expect ( $div3 . exists ( ) ) . toBe ( false )
301
- } )
302
-
303
273
it ( 'second div has nested div when not prop lazy' , ( ) => {
304
274
const wrapper = mount ( BModal , {
305
275
global : { stubs : { teleport : true } } ,
@@ -311,19 +281,7 @@ describe.skip('modal', () => {
311
281
expect ( $div3 . exists ( ) ) . toBe ( true )
312
282
} )
313
283
314
- // Any attempt at modifying modelValue with teleport fails
315
- it . skip ( 'second div has nested div when not prop lazy and prop modelValue' , ( ) => {
316
- const wrapper = mount ( BModal , {
317
- global : { stubs : { teleport : true } } ,
318
- props : { lazy : true , modelValue : true } ,
319
- } )
320
- const $div = wrapper . get ( 'div' )
321
- const $div2 = $div . get ( 'div' )
322
- const $div3 = $div2 . find ( 'div' )
323
- expect ( $div3 . exists ( ) ) . toBe ( true )
324
- } )
325
-
326
- it . skip ( 'third nested div has another div' , ( ) => {
284
+ it ( 'third nested div has another div' , ( ) => {
327
285
const wrapper = mount ( BModal , {
328
286
global : { stubs : { teleport : true } } ,
329
287
} )
@@ -333,7 +291,7 @@ describe.skip('modal', () => {
333
291
expect ( $div3 . exists ( ) ) . toBe ( true )
334
292
} )
335
293
336
- // Cannot test emit due to teleport
294
+ // Test isActive states
337
295
338
- // TODO finished modalDialogClasses on second nested div
296
+ // Test emit states
339
297
} )
0 commit comments