Mock HTMLElement.scrollTo in test setup

jsdom does not implement scrollTo on elements, causing any component that
calls element.scrollTo() (e.g. MiniDraftGrid's scroll-to-current-cell
effect) to throw in unit tests.

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1
This commit is contained in:
Claude 2026-04-25 14:36:20 +00:00
parent 8a4c75e860
commit 049f909429
No known key found for this signature in database

View file

@ -10,6 +10,9 @@ afterEach(() => {
// Mock environment variables
process.env.NODE_ENV = 'test';
// jsdom does not implement scrollTo on elements
HTMLElement.prototype.scrollTo = vi.fn();
// Mock BetterAuth
vi.mock('~/lib/auth.server', () => ({
auth: {