Files
hyperframes/packages/studio/tests/chromeTestUtils.browser.test.ts
Miguel Ángel 1819276fc3 test: real-Chrome and CI smoke pages inline GSAP so they wait on no CDN (#6406)
* test(studio): real-Chrome tests inline GSAP so their page waits on no request

* test(ci): smoke projects inline GSAP so required checks wait on no CDN
2026-10-26 08:20:55 +00:00

28 lines
1.1 KiB
TypeScript

import { expect, it, vi } from "vitest";
import { closeTestChrome, launchTestChrome, showWithRuntime } from "./chromeTestUtils";
vi.setConfig({ testTimeout: 60_000 });
it("shows a page that names the GSAP CDN script without the page making a request", async () => {
const browser = await launchTestChrome();
try {
const tab = await browser.newPage();
const requests: string[] = [];
tab.on("request", (request) => requests.push(request.url()));
await showWithRuntime(
tab,
`<!doctype html><html><body>
<div id="root" data-composition-id="main" data-start="0" data-duration="1" data-width="640" data-height="360"></div>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
<script>window.__timelines = window.__timelines || {}; window.__timelines["main"] = gsap.timeline({ paused: true });</script>
</body></html>`,
);
expect(await tab.evaluate(() => typeof (window as unknown as { gsap?: object }).gsap)).toBe(
"object",
);
expect(requests).toEqual([]);
} finally {
await closeTestChrome(browser);
}
});