Summer Sale! All accounts are 50% off this week.

orest's avatar
Level 13

testing reusable vue component

When you have a reusable vue component, for example

<like-button v-if="!post.is_liked" :user="user"></like-button>

And you want to test using dusk or any other testing framework, that

  1. it is visible
  2. it actually sends a request successfully

Do you write tests for every view that actually uses the like button ?

Or do you prefer to test the like button only in 1 view ( just pick one view that uses the button ) and assume that the button works ?

0 likes
1 reply
martinbean's avatar
Level 80

@orest It’s a component. I’d test it using something like Jest.

1 like

Please or to participate in this conversation.