@@ -12,44 +12,42 @@ import {
12
12
import { makeRender } from './_utils'
13
13
14
14
const define = makeRender < any > ( )
15
+ function renderWithSlots ( slots : any ) : any {
16
+ let instance : any
17
+ const Comp = defineComponent ( {
18
+ render ( ) {
19
+ const t0 = template ( '<div></div>' )
20
+ const n0 = t0 ( )
21
+ instance = getCurrentInstance ( )
22
+ return n0
23
+ } ,
24
+ } )
15
25
16
- describe ( 'component: slots' , ( ) => {
17
- function renderWithSlots ( slots : any ) : any {
18
- let instance : any
19
- const Comp = defineComponent ( {
20
- vapor : true ,
21
- render ( ) {
22
- const t0 = template ( '<div></div>' )
23
- const n0 = t0 ( )
24
- instance = getCurrentInstance ( )
25
- return n0
26
- } ,
27
- } )
28
-
29
- const { render } = define ( {
30
- render ( ) {
31
- return createComponent ( Comp , { } , slots )
32
- } ,
33
- } )
26
+ const { render } = define ( {
27
+ render ( ) {
28
+ return createComponent ( Comp , { } , slots )
29
+ } ,
30
+ } )
34
31
35
- render ( )
36
- return instance
37
- }
32
+ render ( )
33
+ return instance
34
+ }
38
35
36
+ describe ( 'component: slots' , ( ) => {
39
37
test ( 'initSlots: instance.slots should be set correctly' , ( ) => {
40
38
const { slots } = renderWithSlots ( { _ : 1 } )
41
39
expect ( slots ) . toMatchObject ( { _ : 1 } )
42
40
} )
43
41
44
42
// NOTE: slot normalization is not supported
45
- // test.todo(
46
- // 'initSlots: should normalize object slots (when value is null, string, array)',
47
- // () => {},
48
- // )
49
- // test.todo(
50
- // 'initSlots: should normalize object slots (when value is function)',
51
- // () => {},
52
- // )
43
+ test . todo (
44
+ 'initSlots: should normalize object slots (when value is null, string, array)' ,
45
+ ( ) => { } ,
46
+ )
47
+ test . todo (
48
+ 'initSlots: should normalize object slots (when value is function)' ,
49
+ ( ) => { } ,
50
+ )
53
51
54
52
test ( 'initSlots: instance.slots should be set correctly' , ( ) => {
55
53
let instance : any
0 commit comments