Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
¿Cómo probar el componente vue.js con broma en el siguiente caso (los datos () se pasan desde el backend)?

Tenemos el siguiente componente vue.js y el objetivo es probar article.title si funciona correctamente. Tenemos la clase de prueba Gridcard.spec.js para usar jest para probar. los datos () que se pasan desde el backend desde la clase Article tienen los siguientes atributos **article.id** **article.title** **article.text** **article.points**

 <template> <div class="col" v-for= " article in articles" v-bind:key= "article.lid" > <h5 class="card-title"> {{ article.title }}</h5> </div> </template> <script> export default { name: 'Gridcard', props: { title: String }, components: { }, data () { return { articles: [], } }, methods: { mounted () { const base = process.env.VUE_APP_BACKEND_BASE_URL + '/api/v1/article' const requestOptions = { method: 'GET', redirect: 'follow' } fetch(base, requestOptions) .then(response => response.json()) .then(result => result.forEach(article=> { this.articles.push(article) })) .catch(error => console.log('error', error)) } } </script> <style scoped> </style>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!