diff --git a/videos/src/PortalPresentation.tsx b/videos/src/PortalPresentation.tsx index 948d3f8..108e8e3 100644 --- a/videos/src/PortalPresentation.tsx +++ b/videos/src/PortalPresentation.tsx @@ -1,6 +1,7 @@ import { AbsoluteFill, Sequence, useVideoConfig, Img, staticFile } from "remotion"; import { inconsolataFont } from "./fonts/inconsolata"; import { PortalIntroScene } from "./scenes/portal/PortalIntroScene"; +import { PortalTitleScene } from "./scenes/portal/PortalTitleScene"; /** * PortalPresentation - Main composition for the Einundzwanzig Portal presentation video @@ -134,7 +135,7 @@ export const PortalPresentation: React.FC = () => { durationInFrames={sceneFrames.portalTitle.duration} premountFor={fps} > - + {/* Scene 3: Dashboard Overview (12s) */} diff --git a/videos/src/scenes/portal/PortalTitleScene.test.tsx b/videos/src/scenes/portal/PortalTitleScene.test.tsx new file mode 100644 index 0000000..1647283 --- /dev/null +++ b/videos/src/scenes/portal/PortalTitleScene.test.tsx @@ -0,0 +1,197 @@ +import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; +import { render, cleanup } from "@testing-library/react"; +import { PortalTitleScene } from "./PortalTitleScene"; + +/* eslint-disable @remotion/warn-native-media-tag */ +// Mock Remotion hooks +vi.mock("remotion", () => ({ + useCurrentFrame: vi.fn(() => 60), + useVideoConfig: vi.fn(() => ({ fps: 30, width: 1920, height: 1080 })), + interpolate: vi.fn((value, inputRange, outputRange, options) => { + const [inMin, inMax] = inputRange; + const [outMin, outMax] = outputRange; + let progress = (value - inMin) / (inMax - inMin); + if (options?.extrapolateLeft === "clamp") { + progress = Math.max(0, progress); + } + if (options?.extrapolateRight === "clamp") { + progress = Math.min(1, progress); + } + return outMin + progress * (outMax - outMin); + }), + spring: vi.fn(() => 1), + AbsoluteFill: vi.fn(({ children, className, style }) => ( +
+ {children} +
+ )), + Img: vi.fn(({ src, className, style }) => ( + + )), + staticFile: vi.fn((path: string) => `/static/${path}`), + Sequence: vi.fn(({ children, from, durationInFrames }) => ( +
+ {children} +
+ )), + Easing: { + out: vi.fn((fn) => fn), + cubic: vi.fn((t: number) => t), + }, +})); + +// Mock @remotion/media +vi.mock("@remotion/media", () => ({ + Audio: vi.fn(({ src, volume }) => ( +