-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: more Embed Page Params filtering tests #16937
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,10 +90,10 @@ test.describe("Popup Tests", () => { | |
}); | ||
|
||
await test.step("Reschedule the booking", async () => { | ||
await addEmbedListeners("popupReschedule"); | ||
await page.goto(`/?popupRescheduleId=${booking.uid}`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed it to |
||
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"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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="); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An assertion to confirm that other non-reserved params are forwarded. |
||
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)", () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added one more scenario that people might be using embed in. By directly passing query params in calLink |
||
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"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved variables to a single place