import '@testing-library/jest-dom'; import { afterEach, vi } from 'vitest'; import { cleanup } from '@testing-library/react'; afterEach(() => { cleanup(); }); // jsdom does not implement ResizeObserver, which Radix primitives (Slider) and // CameraFeed rely on. A no-op stub is enough: tests assert on rendered output, // not on resize-driven behaviour. if (!('ResizeObserver' in globalThis)) { class ResizeObserverStub implements ResizeObserver { observe() {} unobserve() {} disconnect() {} } globalThis.ResizeObserver = ResizeObserverStub; } // jsdom implements neither the Pointer Capture API nor scrollIntoView, both of // which Radix Select calls while opening its dropdown. Without these stubs the // trigger throws `target.hasPointerCapture is not a function` and the listbox // never mounts, so any test that opens a