In general youโre right, but if you wonโt remove the first test, then both will fail. For some people it will be enough to understand a reason just by looking to the names of failed tests.
In your case developer will have to look in the message of failed test.
Thatโs how I understand the idea of writing tests with such granularity
How many tests do you expect to fail if you make the button not available?
I think 2 failing tests are more confusing than one, even if I have to read the message (the title still helps me understand what failed - clicking the button)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I guess, it can help you in the situation when you created a button, but forgot to attach an event listener.
Consider some big refactoring of the component โ it probably can happen
In such case the functionality test would fail thanks to
getByRoleIn general youโre right, but if you wonโt remove the first test, then both will fail. For some people it will be enough to understand a reason just by looking to the names of failed tests.
In your case developer will have to look in the message of failed test.
Thatโs how I understand the idea of writing tests with such granularity
How many tests do you expect to fail if you make the button not available?
I think 2 failing tests are more confusing than one, even if I have to read the message (the title still helps me understand what failed - clicking the button)