From 05c091c26f3d39edafbe261298e7c010692dd741 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 03:52:53 +0000 Subject: [PATCH] Fix unit tests: Expose HTMLStyleElement in JSDOM setup This change addresses a `ReferenceError: HTMLStyleElement is not defined` failure in `tests/position-floating-panel.test.mjs`. The `popoverEngine.js` source code performs an `instanceof HTMLStyleElement` check, which requires the class to be available in the global scope. While JSDOM provides this class, the test setup was not exposing it to the global object. - Updated `tests/position-floating-panel.test.mjs` to add `global.HTMLStyleElement = windowRef.HTMLStyleElement;` in the `beforeEach` block. --- tests/position-floating-panel.test.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/position-floating-panel.test.mjs b/tests/position-floating-panel.test.mjs index bdc76666..a459e59c 100644 --- a/tests/position-floating-panel.test.mjs +++ b/tests/position-floating-panel.test.mjs @@ -75,6 +75,7 @@ beforeEach(async () => { global.HTMLElement = windowRef.HTMLElement; global.Element = windowRef.Element; global.Node = windowRef.Node; + global.HTMLStyleElement = windowRef.HTMLStyleElement; global.getComputedStyle = windowRef.getComputedStyle.bind(windowRef); global.ResizeObserver = StubObserver; if (!global.PointerEvent) {