Types of testing
Our Current testing approach in dashboard
Talk is cheap. Show me the code
Issues in the current testing approach
What is user-centric testing?
Why should I care about user-centric testing?
Talk is cheap. Show me the code again
Why we have used it in our legacy developer portal?
Testing of an individual software component or module.
Testing of several components to ensure that they work together as expected.
Behave like a user to click around the app and verify that it functions correctly.
Coupled with component internal details.
React Component internal state check on the mounting of component.
Calling internal callback methods passed as props to child Components and validating the state change.
Built using React 16.
The testing setup uses Jest + Enzyme.
Changing the structure of the state will fail the tests even if functionality remains the same.
Tests lack readability.
Passing tests does not mean the component will work as intended when the user interacts with it.
Write Tests for your components similar to how a user will interact with them.
Refactoring is possible without breaking the suite if the functionality of components remains the same which gives confidence to the developers.
Tests serve as documentation. By looking at the tests one can infer what functionality the component provides to the user.
We wanted to do refactoring of exiting code and mitigate issues as mentioned above and without tests doing so was a nigntmare
Icons made by Freepik from www.flaticon.com