fix: Across Org Scenarios - Wrong links for event and team (#12358)
Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
1 parent
f1caaad536
commit
e5e0fa97eb
35 files changed
+570
-154
No files matched your search
@@ -39,7 +39,7 @@ type InputWebhook = {
|
||||
/**
|
||||
* Data to be mocked
|
||||
*/
|
||||
type ScenarioData = {
|
||||
export type ScenarioData = {
|
||||
// hosts: { id: number; eventTypeId?: number; userId?: number; isFixed?: boolean }[];
|
||||
/**
|
||||
* Prisma would return these eventTypes
|
||||
@@ -835,10 +835,12 @@ export function getOrganizer({
|
||||
defaultScheduleId,
|
||||
weekStart = "Sunday",
|
||||
teams,
|
||||
organizationId,
|
||||
}: {
|
||||
name: string;
|
||||
email: string;
|
||||
id: number;
|
||||
organizationId?: number | null;
|
||||
schedules: InputUser["schedules"];
|
||||
credentials?: InputCredential[];
|
||||
selectedCalendars?: InputSelectedCalendar[];
|
||||
@@ -849,7 +851,6 @@ export function getOrganizer({
|
||||
}) {
|
||||
return {
|
||||
...TestData.users.example,
|
||||
organizationId: null as null | number,
|
||||
name,
|
||||
email,
|
||||
id,
|
||||
@@ -860,6 +861,7 @@ export function getOrganizer({
|
||||
defaultScheduleId,
|
||||
weekStart,
|
||||
teams,
|
||||
organizationId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -904,6 +906,7 @@ export function getScenarioData(
|
||||
eventTypes: eventTypes.map((eventType, index) => {
|
||||
return {
|
||||
...eventType,
|
||||
teamId: eventType.teamId || null,
|
||||
title: `Test Event Type - ${index + 1}`,
|
||||
description: `It's a test event type - ${index + 1}`,
|
||||
};
|
||||
@@ -911,6 +914,7 @@ export function getScenarioData(
|
||||
users: users.map((user) => {
|
||||
const newUser = {
|
||||
...user,
|
||||
organizationId: user.organizationId ?? null,
|
||||
};
|
||||
if (user.destinationCalendar) {
|
||||
newUser.destinationCalendar = {
|
||||
@@ -924,7 +928,7 @@ export function getScenarioData(
|
||||
apps: [...apps],
|
||||
webhooks,
|
||||
bookings: bookings || [],
|
||||
};
|
||||
} satisfies ScenarioData;
|
||||
}
|
||||
|
||||
export function enableEmailFeature() {
|
||||
|
||||
@@ -136,7 +136,7 @@ expect.extend({
|
||||
|
||||
return {
|
||||
pass: false,
|
||||
message: () => `Email content ${isNot ? "is" : "is not"} matching`,
|
||||
message: () => `Email content ${isNot ? "is" : "is not"} matching. ${JSON.stringify(emailsToLog)}`,
|
||||
actual: actualEmailContent,
|
||||
expected: expectedEmailContent,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user