@@ -83,7 +83,7 @@ describe('component props (vapor)', () => {
83
83
let props : any
84
84
// TODO: attrs
85
85
86
- const Comp : FunctionalComponent = ( _props ) => {
86
+ const Comp : FunctionalComponent = _props => {
87
87
const instance = getCurrentInstance ( ) !
88
88
props = instance . props
89
89
return { }
@@ -121,7 +121,7 @@ describe('component props (vapor)', () => {
121
121
let props : any
122
122
// TODO: attrs
123
123
124
- const Comp : FunctionalComponent = ( _props ) => {
124
+ const Comp : FunctionalComponent = _props => {
125
125
const instance = getCurrentInstance ( ) !
126
126
props = instance . props
127
127
return { }
@@ -218,10 +218,12 @@ describe('component props (vapor)', () => {
218
218
host ,
219
219
)
220
220
expect ( props . foo ) . toBe ( 2 )
221
- const prevBar = props . bar
222
- // expect(props.bar).toEqual({ a: 1 }) // FIXME: failed
221
+ // const prevBar = props.bar
222
+ props . bar
223
+ expect ( props . bar ) . toEqual ( { a : 1 } )
223
224
expect ( props . baz ) . toEqual ( defaultBaz )
224
- // expect(defaultFn).toHaveBeenCalledTimes(1) // FIXME: failed
225
+ // expect(defaultFn).toHaveBeenCalledTimes(1) // failed: (caching is not supported)
226
+ expect ( defaultFn ) . toHaveBeenCalledTimes ( 2 )
225
227
expect ( defaultBaz ) . toHaveBeenCalledTimes ( 0 )
226
228
227
229
// #999: updates should not cause default factory of unchanged prop to be
@@ -236,9 +238,9 @@ describe('component props (vapor)', () => {
236
238
host ,
237
239
)
238
240
expect ( props . foo ) . toBe ( 3 )
239
- // expect(props.bar).toEqual({ a: 1 }) // FIXME: failed
240
- expect ( props . bar ) . toBe ( prevBar )
241
- // expect(defaultFn).toHaveBeenCalledTimes(1) // FIXME: failed
241
+ expect ( props . bar ) . toEqual ( { a : 1 } )
242
+ // expect(props.bar).toBe(prevBar) // failed: (caching is not supported )
243
+ // expect(defaultFn).toHaveBeenCalledTimes(1) // failed: caching is not supported (called 3 times)
242
244
243
245
render (
244
246
Comp as any ,
@@ -251,7 +253,7 @@ describe('component props (vapor)', () => {
251
253
)
252
254
expect ( props . foo ) . toBe ( 1 )
253
255
expect ( props . bar ) . toEqual ( { b : 2 } )
254
- // expect(defaultFn).toHaveBeenCalledTimes(1) // FIXME: failed
256
+ // expect(defaultFn).toHaveBeenCalledTimes(1) // failed: caching is not supported (called 3 times)
255
257
256
258
render (
257
259
Comp as any ,
@@ -267,7 +269,7 @@ describe('component props (vapor)', () => {
267
269
)
268
270
expect ( props . foo ) . toBe ( 3 )
269
271
expect ( props . bar ) . toEqual ( { b : 3 } )
270
- // expect(defaultFn).toHaveBeenCalledTimes(1) // FIXME: failed
272
+ // expect(defaultFn).toHaveBeenCalledTimes(1) // failed: caching is not supported (called 3 times)
271
273
272
274
render (
273
275
Comp as any ,
@@ -280,7 +282,7 @@ describe('component props (vapor)', () => {
280
282
)
281
283
expect ( props . foo ) . toBe ( 1 )
282
284
expect ( props . bar ) . toEqual ( { b : 4 } )
283
- // expect(defaultFn).toHaveBeenCalledTimes(1) // FIXME: failed
285
+ // expect(defaultFn).toHaveBeenCalledTimes(1) // failed: caching is not supported (called 3 times)
284
286
} )
285
287
286
288
test ( 'using inject in default value factory' , ( ) => {
0 commit comments