...

/

Improving Tests

Improving Tests

In this lesson, you’ll learn how to improve the tests.

We have now written a couple of tests that guard against breaking the existing functionality. However, they are in the “just works” phase, and there are various things we can do to make them more resilient and more pleasant to write.

Using data attributes for designating elements in testing

If we take a look at our second test, the elements we trigger events on and assert against are specified either by tag name (button, input) or the CSS class (p.text-center). The problem with this is two-fold. First, they are not precise enough, and there can be ...

Access this course and 1400+ top-rated courses and projects.