fix(orgs): use runtime origin for booker URL fallback#28851
fix(orgs): use runtime origin for booker URL fallback#28851ShipItAndPray wants to merge 1 commit intocalcom:mainfrom
Conversation
|
|
📝 WalkthroughWalkthroughA new test suite for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/features/ee/organizations/lib/getBookerUrlServer.test.ts (1)
31-35: Add a symmetric brand-domain test forgetTeamBookerUrl.
getBookerBaseUrlhas brand-domain coverage, butgetTeamBookerUrlbrand behavior is currently untested. Adding it would prevent regressions.➕ Suggested test addition
it("prefers the organization brand full domain when available", async () => { vi.mocked(getBrand).mockResolvedValueOnce({ fullDomain: "https://acme.cal.eu" } as never); await expect(getBookerBaseUrl(123)).resolves.toBe("https://acme.cal.eu"); }); + + it("prefers the organization brand full domain for team URLs when available", async () => { + vi.mocked(getBrand).mockResolvedValueOnce({ fullDomain: "https://acme.cal.eu" } as never); + + await expect(getTeamBookerUrl({ organizationId: 123 })).resolves.toBe("https://acme.cal.eu"); + }); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/features/ee/organizations/lib/getBookerUrlServer.test.ts` around lines 31 - 35, Add a symmetric unit test that verifies getTeamBookerUrl prefers the organization brand fullDomain like the existing getBookerBaseUrl test: mock getBrand (vi.mocked(getBrand).mockResolvedValueOnce({ fullDomain: "https://acme.cal.eu" } as never)) and assert await expect(getTeamBookerUrl(123)).resolves.toBe("https://acme.cal.eu"); name the test something like "getTeamBookerUrl prefers the organization brand full domain when available" so it mirrors the getBookerBaseUrl coverage and prevents regression.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/features/ee/organizations/lib/getBookerUrlServer.test.ts`:
- Around line 31-35: Add a symmetric unit test that verifies getTeamBookerUrl
prefers the organization brand fullDomain like the existing getBookerBaseUrl
test: mock getBrand (vi.mocked(getBrand).mockResolvedValueOnce({ fullDomain:
"https://acme.cal.eu" } as never)) and assert await
expect(getTeamBookerUrl(123)).resolves.toBe("https://acme.cal.eu"); name the
test something like "getTeamBookerUrl prefers the organization brand full domain
when available" so it mirrors the getBookerBaseUrl coverage and prevents
regression.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37b6d7df-e4b1-4bdd-9cba-477d64f711ca
📒 Files selected for processing (2)
packages/features/ee/organizations/lib/getBookerUrlServer.test.tspackages/features/ee/organizations/lib/getBookerUrlServer.ts
Fixes #28829\n\nThe null-org fallback in getBookerBaseUrl/getTeamBookerUrl now uses the runtime webapp origin via getOrgFullOrigin(null) instead of WEBSITE_URL, so EU shard booking emails build reschedule/cancel links with app.cal.eu rather than cal.com.\n\nValidation:\n- corepack yarn vitest run packages/features/ee/organizations/lib/getBookerUrlServer.test.ts packages/features/ee/organizations/lib/orgDomains.test.ts\n- corepack yarn exec biome check packages/features/ee/organizations/lib/getBookerUrlServer.ts packages/features/ee/organizations/lib/getBookerUrlServer.test.ts\n- git diff --check