Files
coder/site/test/setup/domStubs.ts
T
2026-04-10 14:04:24 -06:00

14 lines
544 B
TypeScript

// Monaco editor calls document.queryCommandSupported at import time,
// which is absent from JSDOM.
if (typeof document.queryCommandSupported !== "function") {
document.queryCommandSupported = () => false;
}
// Pointer capture stubs required for Radix UI in JSDOM.
globalThis.HTMLElement.prototype.hasPointerCapture = vi
.fn()
.mockReturnValue(false);
globalThis.HTMLElement.prototype.releasePointerCapture = vi.fn();
globalThis.HTMLElement.prototype.scrollIntoView = vi.fn();
globalThis.HTMLElement.prototype.setPointerCapture = vi.fn();