mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
- Render blocks in iframe instead of just name - Add drag handle on left side - Show trash button on hover (top-right) - Display block name in footer - Preview shows actual block content - Better visual feedback for building pages
30 lines
705 B
TypeScript
30 lines
705 B
TypeScript
import "@testing-library/jest-dom"
|
|
import { vi } from "vitest"
|
|
|
|
// Polyfill ResizeObserver for tests
|
|
global.ResizeObserver = class ResizeObserver {
|
|
observe() {}
|
|
unobserve() {}
|
|
disconnect() {}
|
|
}
|
|
|
|
// Mock window.matchMedia
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: vi.fn().mockImplementation(query => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(),
|
|
removeListener: vi.fn(),
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})),
|
|
})
|
|
|
|
// Mock document.elementFromPoint for OTP input
|
|
if (typeof document !== 'undefined') {
|
|
document.elementFromPoint = vi.fn().mockReturnValue(null)
|
|
}
|