Skip to content

Test Framework ‐ Jest React Testing Framework

Harsh Deep edited this page Jun 11, 2024 · 7 revisions

The project follows the industry standards with Jest for component testing which is paired with React Testing Library (@testing-library/react) for nice UI selectors that work with React. The tests are run on the CI before merge, and it's a good idea to have new tests for any new functionality we add. We also use @testing-library/user-event for simulating realistic user events.

Examples

  • NewEPubModal.test.js is a good example to look at if you're starting with test cases. It has an example of mocking, varying props, selectors and checking for UI components. Originally introduced in PR #802.
  • InstructorList.test.js covers user-event based interactions based on keyboard typing and mouse clicks that refresh the screen

Helpful Links