setup.ts 480 B

1234567891011121314151617181920
  1. import '@testing-library/jest-dom';
  2. import { vi } from 'vitest';
  3. // Mock sonner
  4. vi.mock('sonner', () => ({
  5. toast: {
  6. success: vi.fn(),
  7. error: vi.fn(),
  8. warning: vi.fn(),
  9. info: vi.fn()
  10. }
  11. }));
  12. // Mock scrollIntoView for Radix UI components
  13. Element.prototype.scrollIntoView = vi.fn();
  14. // Mock hasPointerCapture for Radix UI components
  15. if (typeof Element.prototype.hasPointerCapture === 'undefined') {
  16. Element.prototype.hasPointerCapture = vi.fn(() => false);
  17. }