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.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-14 03:52:53 +00:00
1 parent 05a922687f
commit 05c091c26f
1 file changed
+1
+1
View File
@@ -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) {