Skip to content

Commit

Permalink
fix: getPublicEventType of NonOrgUser fetch OrgUser event-type of sam…
Browse files Browse the repository at this point in the history
…e username (#15587)

* fix: getPublicEventType of NonOrgUser fetch OrgUser event-type with same username

* Fix the test that was supposed to verify the scenario

---------

Co-authored-by: Hariom <hariombalhara@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
  • Loading branch information
3 people authored Jun 27, 2024
1 parent 3948b8d commit 3a2a70d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/web/playwright/organization/booking.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { JSDOM } from "jsdom";
import { uuid } from "short-uuid";

import { getOrgUsernameFromEmail } from "@calcom/features/auth/signup/utils/getOrgUsernameFromEmail";
import { WEBAPP_URL } from "@calcom/lib/constants";
Expand Down Expand Up @@ -28,9 +29,9 @@ function getOrgOrigin(orgSlug: string | null) {
}

test.describe("Bookings", () => {
test.afterEach(({ orgs, users }) => {
orgs.deleteAll();
users.deleteAll();
test.afterEach(async ({ orgs, users, page }) => {
await users.deleteAll();
await orgs.deleteAll();
});

test.describe("Team Event", () => {
Expand Down Expand Up @@ -324,6 +325,8 @@ test.describe("Bookings", () => {
const username = "john";
const userInsideOrganization = await users.create({
username,
useExactUsername: true,
email: `john-inside-${uuid()}@example.com`,
name: "John Inside Organization",
organizationId: org.id,
roleInOrganization: MembershipRole.MEMBER,
Expand All @@ -339,6 +342,8 @@ test.describe("Bookings", () => {
const userOutsideOrganization = await users.create({
username,
name: "John Outside Organization",
email: `john-outside-${uuid()}@example.com`,
useExactUsername: true,
eventTypes: [
{
title: "John Outside Org's Meeting",
Expand Down
1 change: 1 addition & 0 deletions packages/features/eventtypes/lib/getPublicEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export const getPublicEvent = async (
}
: {
username,
profiles: { none: {} },
}),
},
},
Expand Down

0 comments on commit 3a2a70d

Please sign in to comment.