Skip to content

🎥 Make videos programmatically with React

Update asset-calculation.test.tsx

Jonny Burger4833b728a46c
diff --git a/packages/renderer/src/test/asset-calculation.test.tsx b/packages/renderer/src/test/asset-calculation.test.tsx
index a328272e9a..ab7bc1c816 100644
--- a/packages/renderer/src/test/asset-calculation.test.tsx
+++ b/packages/renderer/src/test/asset-calculation.test.tsx
@@ -139,15 +139,16 @@ test('Should calculate volumes correctly', async () => {
expect(withoutId(assetPositions[0])).toEqual({
type: 'video',
src: 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4',
- duration: 60,
- startInVideo: 0,
- trimLeft: 0,
+ duration: 59,
+ startInVideo: 1,
+ trimLeft: 1,
playbackRate: 1,
volume: new Array(60)
.fill(true)
.map((_, i) =>
interpolate(i, [0, 4], [0, 1], {extrapolateRight: 'clamp'})
- ),
+ )
+ .filter((f) => f > 0),
});
});
@@ -175,15 +176,18 @@ test('Should calculate startFrom correctly', async () => {
expect(withoutId(assetPositions[0])).toEqual({
type: 'audio',
src: 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4',
- duration: 59,
- startInVideo: 1,
- trimLeft: 100,
+ duration: 58,
+ startInVideo: 2,
+ trimLeft: 101,
playbackRate: 1,
- volume: new Array(59).fill(true).map((_, i) =>
- interpolate(i, [0, 50, 100], [0, 1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })
- ),
+ volume: new Array(59)
+ .fill(true)
+ .map((_, i) =>
+ interpolate(i, [0, 50, 100], [0, 1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })
+ )
+ .filter((i) => i > 0),
});
});