lundi 8 juin 2020

Why does React JS UI Components tests matter?

I want to layout an example, before asking the question:

You create a reactjs app, and have a site with a header at top, a section below header and then at the bottom we have a footer. The code will look something like this:

<header>...</header>
<section>...</section>
<footer>...</footer>

Now, the question why it is worth testing these ui components?

I am not able to understand, why we test resultant HTML of the webpage, because it it not going to break our site, or improve our app in any way, on the other side it makes sense to test the backend of the app, or we can test some functions that perform some calculations, because it makes sense to test them, as they will be responsible for filling the html skeleton with data.

Aucun commentaire:

Enregistrer un commentaire