Skip to content

Commit

Permalink
Fix command types
Browse files Browse the repository at this point in the history
  • Loading branch information
burakkaygusuz committed Oct 19, 2023
1 parent 6839f11 commit 62383a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
44 changes: 5 additions & 39 deletions cypress/support/commands/request.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getBookingIds = (qs?: {
lastname?: string;
checkin?: string;
checkout?: string;
}) => {
}): Cypress.Chainable<Cypress.Response<Array<{ bookingId: string }>>> => {
return cy.request({
method: 'GET',
url: '/booking',
Expand All @@ -39,7 +39,7 @@ const getBookingIds = (qs?: {
const getBooking = (
bookingId: number,
qs?: { firstname?: string; lastname?: string; checkin?: string; checkout?: string },
) => {
): Cypress.Chainable<Cypress.Response<Booking>> => {
return cy.request({
method: 'GET',
url: `/booking/${bookingId}`,
Expand All @@ -52,17 +52,7 @@ const createBooking = (
): Cypress.Chainable<
Cypress.Response<{
bookingid: number;
booking: {
firstname: string;
lastname: string;
totalprice: number;
depositpaid: boolean;
bookingdates: {
checkin: string;
checkout: string;
};
additionalneeds: 'Breakfast' | 'Launch' | 'Dinner';
};
booking: Booking;
}>
> => {
return cy.request({
Expand All @@ -75,19 +65,7 @@ const createBooking = (
const updateBooking = (
bookingId: number,
booking: Booking,
): Cypress.Chainable<
Cypress.Response<{
firstname: string;
lastname: string;
totalprice: number;
depositpaid: boolean;
bookingdates: {
checkin: string;
checkout: string;
};
additionalneeds: 'Breakfast' | 'Launch' | 'Dinner';
}>
> => {
): Cypress.Chainable<Cypress.Response<Booking>> => {
return cy.request({
method: 'PUT',
url: `/booking/${bookingId}`,
Expand All @@ -98,19 +76,7 @@ const updateBooking = (
const partialUpdateBooking = (
bookingId: number,
booking: Booking,
): Cypress.Chainable<
Cypress.Response<{
firstname: string;
lastname: string;
totalprice: number;
depositpaid: boolean;
bookingdates: {
checkin: string;
checkout: string;
};
additionalneeds: 'Breakfast' | 'Launch' | 'Dinner';
}>
> => {
): Cypress.Chainable<Cypress.Response<Booking>> => {
return cy.request({
method: 'PATCH',
url: `/booking/${bookingId}`,
Expand Down
2 changes: 1 addition & 1 deletion cypress/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type Booking = {
checkin: string;
checkout: string;
};
additionalneeds?: string;
additionalneeds?: 'Breakfast' | 'Launch' | 'Dinner';
};

0 comments on commit 62383a6

Please sign in to comment.