mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
14 lines
544 B
TypeScript
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();
|