The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.
TypeScript agent-skillsagentic-aiai-agentsai-videobyokclaude-codecodexdeepseek-harnessdsh-plugingenerative-ailocal-firstmcpmotionmotion-graphicsmultimodalopenmotionreverse-engineeringvideo-editingvideo-generationworkbuddy
// @vitest-environment happy-dom
import { act } from 'react';
import { createRoot } from 'react-dom/client';
import { expect, it, vi } from 'vitest';
import { PreviewEmptyState } from './PreviewEmptyState';
import { PreviewReadOnlyProvider } from '../editor/previewReadOnlyContext';
const gateway = vi.hoisted(() => ({ importFiles: vi.fn() }));
vi.mock('../../motion/MediaGatewayContext', () => ({ useMediaGateway: () => gateway }));
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
it('opens the existing importer, omits decorative media icons and respects write protection', () => {
const host = document.createElement('div'); const root = createRoot(host);
act(() => root.render(<PreviewEmptyState />));
expect(host.textContent).toContain('Drop video, audio or images here');
expect(host.querySelector('svg')).toBeNull();
act(() => host.querySelector('button')!.click()); expect(gateway.importFiles).toHaveBeenCalledOnce();
act(() => root.render(<PreviewReadOnlyProvider readOnly><PreviewEmptyState /></PreviewReadOnlyProvider>));
expect(host.querySelector('button')!.disabled).toBe(true);
act(() => host.querySelector('button')!.click()); expect(gateway.importFiles).toHaveBeenCalledOnce();
act(() => root.unmount());
});