test: 🧪 Add tests for verifying API calls using pw-api-plugin #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the codebase, focusing on adding new functionality and improving test coverage. The most important changes include the addition of a new
Booking
interface, the introduction of new API tests, and the inclusion of a new plugin dependency inpackage.json
.New Functionality:
Booking
interface inlib/booking.ts
to define the structure of a booking object, including properties for booking ID, room ID, guest names, deposit status, and booking dates.Test Enhancements:
tests/api.booking.spec.ts
for various GET requests related to booking, including fetching booking summaries, all bookings, and specific bookings by ID. These tests also include utility functions for authentication and validating booking details.tests/api.data.pwplugin.spec.ts
using thepw-api-plugin
for performing CRUD operations on a sample API. This includes tests for GET, HEAD, POST, PUT, PATCH, DELETE, and FETCH requests.Dependency Updates:
package.json
to include the newpw-api-plugin
dependency, which is used in the new API tests.