mercredi 10 mars 2021

What's the best way to test props you pass to child components?

I'm testing a component in and I'm wondering what's the best way to test you are passing the correct values to a child components in it's props.

For example, test the values that the "items" attribute is given.

<template>
    <component-1 :items="myItems"/>
</template>

I know you can view the props with Vue test utils' props(), but is this the ideal way?

Aucun commentaire:

Enregistrer un commentaire