ama
ama copied to clipboard
Functional tests vs Testing user flow
So I just completed Kent C Dodd’s Testing Javascript and as a whole it is fantastic and gave me a new way of looking at things. So I am currently on a project that when given a schema will dynamically generate a form. I have applied the concepts I’ve learnt from the course on this project but find I’m still asking questions about writing tests from a users pov... For instance, i have a test that covers validation, the unit test simulates a click event in a submit button and waits for a data test Id element to appear. At the time this test was failing, the unit test correctly picked up on this, however I had to drill down in the stack trace to find out exactly where the issue was.
Writing functional tests would have told me exactly where the error occurred but would I then be doubling up tests? Can I please get your thoughts?
Could you clarify what you mean by "Functional tests?" Most people that I've talked to use this term interchangeably with End to End tests which typically gives you more code coverage, but makes it harder to identify the code that's causing problems (because it's further removed from the implementation).
So when you say:
Writing functional tests would have told me exactly where the error occurred
I'm thinking you're using functional tests interchangeably with "unit tests" ... 🤔
Yes sorry it should be unit tests