Testing - RoBorregos/roborregos-web GitHub Wiki
UI/UX Testing [WIP]
Responsivity
Developers can use the inspector to view their design in different screen sizes (phone and ipad). For monitor sizes we can recommend:
- 3840x2160
- 2560x1600
- 1920x1080
- 1617x789
- 1600x900
- 1536x864
- 1440x900
- 1366x768
- 1280x720
- your own screen size
Unit Testing of components
We make use of Jest, the React Testing Library and Enzyme to test component functionality and simulate runtime events.
Just npm install
to install all test dependencies and run:
npm test
to run all tests.
Default tests
All components must validate at least:
- Renderization of (main) structural components
- Correct order of elements with a Snapshot match testing
Functional tests
Tests must be done to validate the functionality of the following:
- Button clicks
- Scrolls
- Keypress
- Dynamic components
- Responsivity
- Events that create any state changes in a component
- Timing a dynamic component
- Structure of the component in the DOM
- Image requires (when sourcing it to img components)
There are many examples of how all these tests can be implemented in the Members, About, and Projects modules.
Using Enzyme is recommended to test event management.