Solution: Unit Tests
Here’s the solution of how to write unit tests using the Jest and Vue testing libraries.
We'll cover the following...
Solution
Your task was to write tests for the Pagination
component. Here are the changes required:
For the src/components/pagination.spec.js
file:
- The
Paginate forward
test should utilize therenderPagination
helper to mount thePagination
component and destructure thegetByText
method to access the “Next” button. A click event should be