diff --git a/packages/embeds/embed-core/index.html b/packages/embeds/embed-core/index.html
index eb59d5dfea..9a9fc5be4c 100644
--- a/packages/embeds/embed-core/index.html
+++ b/packages/embeds/embed-core/index.html
@@ -4,6 +4,13 @@
+
Popup Examples - Reschedule Tests
+
+
+ Popup Examples - Different Configurations
+
+
+ Popup Examples - Routing Form Tests
@@ -292,13 +311,8 @@
data-cal-link="forms/948ae412-d995-4865-875a-48302588de03">
Book through Routing Form [Dark Theme]
-
-
+ Popup Examples - Child Element Target Tests
I am Anchor
[I am Bold inside anchor]
diff --git a/packages/embeds/embed-core/playground.ts b/packages/embeds/embed-core/playground.ts
index 8dd4fa1460..810c2883a3 100644
--- a/packages/embeds/embed-core/playground.ts
+++ b/packages/embeds/embed-core/playground.ts
@@ -364,7 +364,12 @@ Cal.ns.popupHideEventTypeDetails("ui", {
hideEventTypeDetails: true,
});
-Cal("init", "popupReschedule", {
+Cal("init", "popupRescheduleWithReschedulePath", {
+ debug: true,
+ origin: origin,
+});
+
+Cal("init", "popupRescheduleWithRescheduleUidParam", {
debug: true,
origin: origin,
});
diff --git a/packages/embeds/embed-core/playwright/tests/action-based.e2e.ts b/packages/embeds/embed-core/playwright/tests/action-based.e2e.ts
index 7baa28228d..e4d953e23f 100644
--- a/packages/embeds/embed-core/playwright/tests/action-based.e2e.ts
+++ b/packages/embeds/embed-core/playwright/tests/action-based.e2e.ts
@@ -90,10 +90,10 @@ test.describe("Popup Tests", () => {
});
await test.step("Reschedule the booking", async () => {
- await addEmbedListeners("popupReschedule");
- await page.goto(`/?popupRescheduleId=${booking.uid}`);
- await page.click('[data-cal-namespace="popupReschedule"]');
- const calNamespace = "popupReschedule";
+ const calNamespace = "popupRescheduleWithReschedulePath";
+ await addEmbedListeners(calNamespace);
+ await page.goto(`/?popupRescheduleUid=${booking.uid}`);
+ await page.click(`[data-cal-namespace="${calNamespace}"]`);
const embedIframe = await getEmbedIframe({ calNamespace, page, pathname: booking.eventSlug });
if (!embedIframe) {
throw new Error("Embed iframe not found");
diff --git a/packages/embeds/embed-core/src/embed.test.ts b/packages/embeds/embed-core/src/embed.test.ts
index 1d7e08a93a..6fa860ce3f 100644
--- a/packages/embeds/embed-core/src/embed.test.ts
+++ b/packages/embeds/embed-core/src/embed.test.ts
@@ -83,8 +83,8 @@ describe("Cal", () => {
expect(paramValues).toEqual(["value3"]);
});
- it("should exclude reserved params from page URL(as these could be unintentional to pass these query params to embed, so better to exclude them and avoid crashing the booking page)", () => {
- mockSearchParams("?date=2023-05-01&duration=30");
+ it("should exclude reserved params from the page URL(as these could be unintentional to pass these query params to embed, so better to exclude them and avoid crashing the booking page)", () => {
+ mockSearchParams("?date=2023-05-01&duration=30&hello=world");
const iframe = cal.createIframe({
calLink: "john-doe/meeting",
@@ -96,6 +96,7 @@ describe("Cal", () => {
expect(iframe.src).not.toContain("date=");
expect(iframe.src).not.toContain("duration=");
+ expect(iframe.src).toContain("hello=");
expect(iframe.src).toContain("email=test%40example.com");
});
@@ -115,6 +116,17 @@ describe("Cal", () => {
expect(iframe.src).toContain("email=test%40example.com");
});
+ it("should allow configuring reserved params through direct URL params to embed calLink(as it is explicitly passed by user)", () => {
+ const iframe = cal.createIframe({
+ calLink: "john-doe/meeting?date=2023-05-01&duration=30&email=test@example.com",
+ calOrigin: null,
+ });
+
+ expect(iframe.src).toContain("date=2023-05-01");
+ expect(iframe.src).toContain("duration=30");
+ expect(iframe.src).toContain("email=test%40example.com");
+ });
+
it("should respect forwardQueryParams setting to disable sending page query params but still send the ones in the config", () => {
mockSearchParams("?param1=value");