// @vitest-environment happy-dom import React, { act } from "react"; import { createRoot } from "react-dom/client"; import { afterEach, describe, expect, it, vi } from "vitest"; import type { GsapAnimation } from "@hyperframes/core/gsap-parser"; import { DesignPanelInputProvider } from "../../contexts/DesignPanelInputContext"; import { usePlayerStore } from "../../player/store/playerStore"; import { GsapAnimationSection } from "./GsapAnimationSection"; (globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true; const animationCardMock = vi.hoisted(() => ({ consumers: [] as Array<{ tweenPercentage: number | null; consume: () => void }>, })); vi.mock("./AnimationCard", () => ({ AnimationCard: ({ animation, focusedSegment, onFocusSegmentConsumed, }: { animation: GsapAnimation; focusedSegment: { tweenPercentage: number } | null; onFocusSegmentConsumed: () => void; }) => { animationCardMock.consumers.push({ tweenPercentage: focusedSegment?.tweenPercentage ?? null, consume: onFocusSegmentConsumed, }); return (