Skip to content

🎥 Make videos programmatically with React

Discard changes to packages/web-renderer/src/test/three-duplicate-frames.test.tsx

Jonny Burgercc0425146b71
diff --git a/packages/web-renderer/src/test/three-duplicate-frames.test.tsx b/packages/web-renderer/src/test/three-duplicate-frames.test.tsx
index 98efd68beb..cb8c5bbd63 100644
--- a/packages/web-renderer/src/test/three-duplicate-frames.test.tsx
+++ b/packages/web-renderer/src/test/three-duplicate-frames.test.tsx
@@ -28,26 +28,17 @@ const Mesh: React.FC = () => {
const ThreeTestComponent: React.FC = () => {
const {width, height} = useVideoConfig();
- const frame = useCurrentFrame();
return (
- <div
- style={{
- width,
- height,
- transform: `scale(${frame === 0 ? 0 : 1})`,
- }}
+ <ThreeCanvas
+ width={width}
+ height={height}
+ style={{backgroundColor: 'white'}}
+ camera={{fov: 75, position: [0, 0, 470]}}
>
- <ThreeCanvas
- width={width}
- height={height}
- style={{backgroundColor: 'white'}}
- camera={{fov: 75, position: [0, 0, 470]}}
- >
- <ambientLight intensity={0.15} />
- <pointLight args={[undefined, 0.4]} position={[200, 200, 0]} />
- <Mesh />
- </ThreeCanvas>
- </div>
+ <ambientLight intensity={0.15} />
+ <pointLight args={[undefined, 0.4]} position={[200, 200, 0]} />
+ <Mesh />
+ </ThreeCanvas>
);
};
@@ -91,7 +82,7 @@ const framesAreIdentical = (a: Uint8Array, b: Uint8Array): boolean => {
};
test(
- 'ThreeCanvas should render under a scale(0) ancestor without duplicate frames',
+ 'ThreeCanvas should not produce duplicate frames at 60fps',
{timeout: 60_000},
async (t) => {
if (t.task.file.projectName === 'webkit') {
@@ -120,7 +111,6 @@ test(
});
const duplicates: number[] = [];
- expect(framePixelData).toHaveLength(30);
for (let i = 1; i < framePixelData.length; i++) {
if (framesAreIdentical(framePixelData[i - 1], framePixelData[i])) {
duplicates.push(i);