Add embed preview tests (#2969)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/2966/head^2
parent
f0a5b7734f
commit
079016052d
|
@ -0,0 +1,25 @@
|
|||
import { expect } from "@playwright/test";
|
||||
|
||||
import { test } from "../fixtures/fixtures";
|
||||
|
||||
test("Preview - embed-core should load", async ({ page }) => {
|
||||
await page.goto("http://localhost:3000/embed/preview.html");
|
||||
const libraryLoaded = await page.evaluate(() => {
|
||||
return new Promise((resolve) => {
|
||||
setInterval(() => {
|
||||
if (
|
||||
(
|
||||
window as unknown as {
|
||||
Cal: {
|
||||
__css: string;
|
||||
};
|
||||
}
|
||||
).Cal.__css
|
||||
) {
|
||||
resolve(true);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
expect(libraryLoaded).toBe(true);
|
||||
});
|
|
@ -1,4 +1,5 @@
|
|||
require("dotenv").config({ path: "../../.env" });
|
||||
const path = require("path");
|
||||
require("dotenv").config({ path: path.join(__dirname, "..", "..", ".env") });
|
||||
process.env.EMBED_PUBLIC_VERCEL_URL = process.env.VERCEL_URL;
|
||||
process.env.EMBED_PUBLIC_WEBAPP_URL = process.env.NEXT_PUBLIC_WEBAPP_URL;
|
||||
process.env.EMBED_PUBLIC_EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL;
|
||||
|
|
Loading…
Reference in New Issue