1
1
// NOTE: This test is implemented based on the case of `runtime-core/__test__/componentProps.spec.ts`.
2
2
3
+ // NOTE: not supported
4
+ // mixins
5
+ // caching
6
+
3
7
import { defineComponent } from '../src/apiDefineComponent'
4
8
5
9
import type { FunctionalComponent } from '../src/component'
@@ -77,7 +81,7 @@ describe('component props (vapor)', () => {
77
81
} )
78
82
79
83
test ( 'stateful with setup' , ( ) => {
80
- // FIXME: is it necessary?
84
+ // TODO:
81
85
} )
82
86
83
87
test ( 'functional with declaration' , ( ) => {
@@ -287,7 +291,34 @@ describe('component props (vapor)', () => {
287
291
} )
288
292
289
293
test ( 'using inject in default value factory' , ( ) => {
290
- // FIXME: is it necessary?
294
+ // TODO: impl inject
295
+ } )
296
+
297
+ // NOTE: maybe it's unnecessary
298
+ // https://github.com/vuejs/core-vapor/pull/99#discussion_r1472647377
299
+ test ( 'optimized props updates' , async ( ) => {
300
+ // TODO:
301
+ } )
302
+
303
+ describe ( 'validator' , ( ) => {
304
+ // TODO: impl validator
305
+ } )
306
+
307
+ test ( 'warn props mutation' , ( ) => {
308
+ // TODO: impl warn
309
+ } )
310
+
311
+ test ( 'warn absent required props' , ( ) => {
312
+ // TODO: impl warn
313
+ } )
314
+
315
+ test ( 'warn on type mismatch' , ( ) => {
316
+ // TODO: impl warn
317
+ } )
318
+
319
+ // #3495
320
+ test ( 'should not warn required props using kebab-case' , async ( ) => {
321
+ // TODO: impl warn
291
322
} )
292
323
293
324
test ( 'props type support BigInt' , ( ) => {
@@ -324,35 +355,35 @@ describe('component props (vapor)', () => {
324
355
} )
325
356
326
357
// #3288
327
- // test('declared prop key should be present even if not passed', async () => {
328
- // let initialKeys: string[] = []
329
- // const changeSpy = vi.fn()
330
- // const passFoo = ref(false)
331
- // const Comp = {
332
- // props: ['foo'],
333
- // setup() {
334
- // const instance = getCurrentInstance()!
335
- // initialKeys = Object.keys(instance.props)
336
- // watchEffect(changeSpy)
337
- // return {}
338
- // },
339
- // render() {
340
- // return {}
341
- // },
342
- // }
343
- // const Parent = createIf(
344
- // () => passFoo.value,
345
- // () => {
346
- // return render(Comp , { foo: 1 }, host) // TODO: createComponent fn
347
- // },
348
- // )
349
- // // expect(changeSpy).toHaveBeenCalledTimes(1)
350
- // })
358
+ test ( 'declared prop key should be present even if not passed' , async ( ) => {
359
+ // let initialKeys: string[] = []
360
+ // const changeSpy = vi.fn()
361
+ // const passFoo = ref(false)
362
+ // const Comp = {
363
+ // props: ['foo'],
364
+ // setup() {
365
+ // const instance = getCurrentInstance()!
366
+ // initialKeys = Object.keys(instance.props)
367
+ // watchEffect(changeSpy)
368
+ // return {}
369
+ // },
370
+ // render() {
371
+ // return {}
372
+ // },
373
+ // }
374
+ // const Parent = createIf(
375
+ // () => passFoo.value,
376
+ // () => {
377
+ // return render(Comp , { foo: 1 }, host) // TODO: createComponent fn
378
+ // },
379
+ // )
380
+ // // expect(changeSpy).toHaveBeenCalledTimes(1)
381
+ } )
351
382
352
383
// #3371
353
- // test(`avoid double-setting props when casting`, async () => {
354
- // // TODO: proide, slots
355
- // })
384
+ test ( `avoid double-setting props when casting` , async ( ) => {
385
+ // TODO: proide, slots
386
+ } )
356
387
357
388
test ( 'support null in required + multiple-type declarations' , ( ) => {
358
389
const Comp = defineComponent ( {
@@ -371,10 +402,10 @@ describe('component props (vapor)', () => {
371
402
} ) . not . toThrow ( )
372
403
} )
373
404
374
- // // #5016
375
- // test('handling attr with undefined value', () => {
376
- // // TODO: attrs
377
- // })
405
+ // #5016
406
+ test ( 'handling attr with undefined value' , ( ) => {
407
+ // TODO: attrs
408
+ } )
378
409
379
410
// #691ef
380
411
test ( 'should not mutate original props long-form definition object' , ( ) => {
@@ -392,11 +423,4 @@ describe('component props (vapor)', () => {
392
423
393
424
expect ( Object . keys ( props . msg ) . length ) . toBe ( 1 )
394
425
} )
395
-
396
- // NOTE: not supported
397
- // optimized props update
398
- // mixins
399
- // validator
400
- // warn
401
- // caching
402
426
} )
0 commit comments