-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Querying by id and classes is the Hello World of the frontend querying and the library doesn't allow that for now.
What about creating the getById
and getByClass
on the tests?
Restricting the frontend id querying is not improving, it is quite the opposite, what is really does is decrease the capacity of the library.
Placing a lot of data-testids
on the code pollutes it, because it places unnecessary tags on html codes in terms of code functionality. The code becomes polluted with tags only related for testing.
I am in favor of TDDs, but adding things in the code (or worse: on html tags) only for testing is exaggerated. A good TDD will improve the code with more organization! A bad TDD will add things on code only related for testing purposes.
Some people can argue and defend the usage of data-testids
on the code for whatever reason, but what I find uncomfortable is to disable for everybody the most basic querying on DOM elements.