Skip to content
Merged
11 changes: 11 additions & 0 deletions apps/frontend/src/__tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ if (typeof HTMLElement !== 'undefined' && !HTMLElement.prototype.scrollIntoView)
});
}

// Mock requestAnimationFrame/cancelAnimationFrame for jsdom
// Required by useXterm.ts which uses requestAnimationFrame for initial fit
if (typeof global.requestAnimationFrame === 'undefined') {
global.requestAnimationFrame = vi.fn((callback: FrameRequestCallback) => {
return setTimeout(() => callback(Date.now()), 0) as unknown as number;
});
global.cancelAnimationFrame = vi.fn((id: number) => {
clearTimeout(id);
});
}

// Test data directory for isolated file operations
export const TEST_DATA_DIR = '/tmp/auto-claude-ui-tests';

Expand Down
Loading
Loading