Skip to content

Commit

Permalink
function expectBookingCancelledWebhookToHaveBeenFired created
Browse files Browse the repository at this point in the history
  • Loading branch information
vikaspatil0021 committed Apr 26, 2024
1 parent d533e7b commit f406bd2
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 5,578 deletions.
38 changes: 38 additions & 0 deletions apps/web/test/utils/bookingScenario/expects.ts
Expand Up @@ -941,6 +941,44 @@ export function expectBookingRescheduledWebhookToHaveBeenFired({
});
}

export function expectBookingCancelledWebhookToHaveBeenFired({
booker,
location,
subscriberUrl,
payload,
}: {
organizer: { email: string; name: string };
booker: { email: string; name: string };
subscriberUrl: string;
location: string;
payload?: Record<string, unknown>;
}) {
expectWebhookToHaveBeenCalledWith(subscriberUrl, {
triggerEvent: "BOOKING_CANCELLED",
payload: {
...payload,
metadata: null,
responses: {
booker: {
label: "your_name",
value: booker.name,
isHidden: false,
},
email: {
label: "email_address",
value: booker.email,
isHidden: false,
},
location: {
label: "location",
value: { optionValue: "", value: location },
isHidden: false,
},
},
},
});
}

export function expectBookingPaymentIntiatedWebhookToHaveBeenFired({
booker,
location,
Expand Down

0 comments on commit f406bd2

Please sign in to comment.