Files
calendar/packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts
T
Pedro CastroandGitHub 99b82c55d5 chore: update direct dependencies (#26172)
Updates:
- vite: 4.5.3→4.5.14, 5.4.6→5.4.21
- nodemailer: 6.7.8→7.0.11
- @playwright/test: 1.45.3→1.55.1
- next-auth: 4.22.1→4.24.13
- class-validator: 0.14.0→0.14.3
- dompurify: 3.2.3→3.3.1

Includes type fixes for next-auth adapter compatibility
2025-12-23 23:42:55 -03:00

68 lines
2.9 KiB
TypeScript

import { expect } from "@playwright/test";
import { test } from "@calcom/web/playwright/lib/fixtures";
import { getEmbedIframe } from "../lib/testUtils";
test.describe("Namespacing", () => {
test.describe("Inline Embed", () => {
test("Add inline embed using a namespace without reload", async ({ page, embeds }) => {
const calNamespace = "withoutReloadNamespace";
await embeds.gotoPlayground({ calNamespace, url: "/" });
await page.click("#add-inline-embed-in-a-new-namespace-without-reload-button");
const embedIframe = await getEmbedIframe({ calNamespace, page, pathname: "/pro" });
await expect(embedIframe).toBeEmbedCalLink(calNamespace, embeds.getActionFiredDetails, {
pathname: "/pro",
searchParams: {
case: "addInlineEmbedInANewNamespaceWithoutReload",
},
});
});
test("Double install Embed Snippet with inline embed using a namespace", async ({ page, embeds }) => {
const calNamespace = "doubleInstall";
await embeds.gotoPlayground({ calNamespace, url: "/" });
await page.click("#double-install-snippet-with-inline-embed-non-default-namespace-button");
const embedIframe = await getEmbedIframe({ calNamespace, page, pathname: "/pro" });
await expect(embedIframe).toBeEmbedCalLink(calNamespace, embeds.getActionFiredDetails, {
pathname: "/pro",
searchParams: {
case: "doubleInstallSnippetWithInlineEmbedWithNonDefaultNamespace",
},
});
await expect(page.locator("iframe")).toHaveCount(1);
});
test("Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)", async ({
page,
embeds,
}) => {
const calNamespace = "";
await embeds.gotoPlayground({ calNamespace, url: "/" });
await page.click("#double-install-snippet-with-inline-embed-default-namespace-button");
const embedIframe = await getEmbedIframe({ calNamespace, page, pathname: "/pro" });
await expect(embedIframe).toBeEmbedCalLink(calNamespace, embeds.getActionFiredDetails, {
pathname: "/pro",
searchParams: {
case: "doubleInstallSnippetWithInlineEmbed",
},
});
await expect(page.locator("iframe")).toHaveCount(1);
});
});
test("Different namespaces can have different init configs", async ({ page, embeds }) => {
await Promise.all([
embeds.addEmbedListeners("namespace-init-test-1"),
embeds.addEmbedListeners("namespace-init-test-2"),
]);
await page.goto("/");
await page.click("#two-different-namespace-with-different-init-config");
const namespace1IframeSrc = await page.locator("iframe").nth(0).getAttribute("src");
const namespace2IframeSrc = await page.locator("iframe").nth(1).getAttribute("src");
expect(namespace1IframeSrc).toContain("http://localhost:3000/pro");
expect(namespace2IframeSrc).toContain("http://127.0.0.1:3000/pro");
});
});