Testing · Senior · Question 72 of 75
What is the main risk of testing through data-testid only?
- ✓Correct answer: Tests don't notice accessibility regressions - an element can lose its role or label and tests still pass
- 2Test ids slow down rendering
- 3They are removed in development builds
Explanation
Role and label queries double as accessibility checks; test ids don't.