mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
14 lines
708 B
TypeScript
14 lines
708 B
TypeScript
/** Configure the shared viewport geometry used by timeline gesture hook tests. */
|
|
export function configureTimelineTestViewport(scroll: HTMLElement, scrollHeight: number): void {
|
|
scroll.getBoundingClientRect = () =>
|
|
({ left: 0, top: 0, right: 800, bottom: 240, width: 800, height: 240 }) as DOMRect;
|
|
Object.defineProperties(scroll, {
|
|
scrollLeft: { configurable: true, writable: true, value: 0 },
|
|
scrollTop: { configurable: true, writable: true, value: 0 },
|
|
scrollWidth: { configurable: true, value: 10_000 },
|
|
scrollHeight: { configurable: true, value: scrollHeight },
|
|
clientWidth: { configurable: true, value: 800 },
|
|
clientHeight: { configurable: true, value: 240 },
|
|
});
|
|
}
|