|
|
|
|
|
by IshKebab
919 days ago
|
|
IMHO UI tests are just too difficult to be worth bothering with in most situations. Maybe AI will change that. But for now I think dev time is generally better invested in other ways of making code work properly, or just fixing bugs that have already been reported. I know that sounds heretical. |
|
Yes, that's because you're doing them wrong.
Don't mess around with the "golden master" testing (edit: seems the frontend ecosystem call that "Snapshot Testing" actually, but it's the same) you see bunch of projects do, that compare the old DOM vs the new DOM you accept/deny changes based on component render output. That's a waste of time and won't actually prevent bugs.
Instead, extract the logic-heavy parts out from your components, then put those under unit tests, like any other code you write.
Boom, easy to maintain, verifies your implementation and makes your UI easier and faster to refactor and build in the first place.