Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(test): add scrollTo polyfill for jsdom test environment

Steven Enamakel9d8b1e8a14a7
diff --git a/app/src/test/setup.ts b/app/src/test/setup.ts
index d5a0855d90..d48ad2309d 100644
--- a/app/src/test/setup.ts
+++ b/app/src/test/setup.ts
@@ -128,6 +128,11 @@ if (typeof Element !== 'undefined' && !Element.prototype.scrollIntoView) {
Element.prototype.scrollIntoView = function () {};
}
+// Polyfill scrollTo for assistant-ui's thread viewport in jsdom.
+if (typeof Element !== 'undefined' && !Element.prototype.scrollTo) {
+ Element.prototype.scrollTo = function () {};
+}
+
// Polyfill the Pointer Capture API for Radix primitives in jsdom.
// Radix's Select, Slider, Toggle and DropdownMenu call these unconditionally
// on pointerdown; jsdom implements none of them, so without this the very