test: more Embed Page Params filtering tests (#16937)

* Add rescheduleUid as config param scenario

* Restructure test buttons

* Use correct namespace as per rename
This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-10-04 12:01:59 +01:00
1 parent 743b155a88
commit 644fb38f87
4 files changed
+57 -26

No files matched your search

+14 -2
View File
@@ -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 protected]",
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");