-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Support adding a non-existent email as the owner of the organiza…
…tion (#14569) * fix: Support adding an non-existent email as the owner of the organization * Remove dead code * fixes * add test * self review changes * Update packages/trpc/server/routers/viewer/organizations/create.handler.ts Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> * Fix typo everywhere --------- Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
- Loading branch information
1 parent
4f57e32
commit 3a0c766
Showing
15 changed files
with
556 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
apps/web/playwright/organization/lib/gotoPathAndExpectRedirectToOrgDomain.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Page } from "@playwright/test"; | ||
import { expect } from "@playwright/test"; | ||
|
||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains"; | ||
|
||
export async function gotoPathAndExpectRedirectToOrgDomain({ | ||
page, | ||
org, | ||
path, | ||
expectedPath, | ||
}: { | ||
page: Page; | ||
org: { slug: string | null }; | ||
path: string; | ||
expectedPath: string; | ||
}) { | ||
if (!org.slug) { | ||
throw new Error("Org slug is not defined"); | ||
} | ||
page.goto(path).catch((e) => { | ||
console.log("Expected navigation error to happen"); | ||
}); | ||
|
||
const orgSlug = org.slug; | ||
|
||
const orgRedirectUrl = await new Promise(async (resolve) => { | ||
page.on("request", (request) => { | ||
if (request.isNavigationRequest()) { | ||
const requestedUrl = request.url(); | ||
console.log("Requested navigation to", requestedUrl); | ||
// Resolve on redirection to org domain | ||
if (requestedUrl.includes(orgSlug)) { | ||
resolve(requestedUrl); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
expect(orgRedirectUrl).toContain(`${getOrgFullOrigin(org.slug)}${expectedPath}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.