mirror of
https://github.com/langgenius/dify.git
synced 2026-04-09 18:00:30 -04:00
40 lines
936 B
TypeScript
40 lines
936 B
TypeScript
import { cleanup } from '@testing-library/react'
|
|
import '@testing-library/jest-dom/vitest'
|
|
import { afterEach } from 'vitest'
|
|
|
|
if (typeof globalThis.ResizeObserver === 'undefined') {
|
|
globalThis.ResizeObserver = class {
|
|
observe() {
|
|
return undefined
|
|
}
|
|
|
|
unobserve() {
|
|
return undefined
|
|
}
|
|
|
|
disconnect() {
|
|
return undefined
|
|
}
|
|
}
|
|
}
|
|
|
|
if (typeof globalThis.IntersectionObserver === 'undefined') {
|
|
globalThis.IntersectionObserver = class {
|
|
readonly root: Element | Document | null = null
|
|
readonly rootMargin = ''
|
|
readonly scrollMargin = ''
|
|
readonly thresholds: ReadonlyArray<number> = []
|
|
constructor(_callback: IntersectionObserverCallback, _options?: IntersectionObserverInit) {}
|
|
observe(_target: Element) {}
|
|
unobserve(_target: Element) {}
|
|
disconnect() {}
|
|
takeRecords(): IntersectionObserverEntry[] {
|
|
return []
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEach(() => {
|
|
cleanup()
|
|
})
|