Skip to content

🎥 Make videos programmatically with React

Update interpolate-styles.test.ts

Jonny Burgera125ec415c64
diff --git a/packages/animation-utils/src/test/interpolate-styles.test.ts b/packages/animation-utils/src/test/interpolate-styles.test.ts
index f7de158bd8..d7334f2338 100644
--- a/packages/animation-utils/src/test/interpolate-styles.test.ts
+++ b/packages/animation-utils/src/test/interpolate-styles.test.ts
@@ -1,3 +1,4 @@
+import {Easing} from 'remotion';
import {expect, test} from 'vitest';
import {interpolateStyles} from '../transformation-helpers/interpolate-styles';
@@ -150,6 +151,27 @@ test('Should be able to use extrapolateRight: "clamp"', () => {
).toEqual({transform: `scale(2) translateX(300px) rotate(60deg)`});
});
+test('Should be able to use Easing', () => {
+ expect(
+ interpolateStyles(
+ 0.5,
+ [0, 1],
+ [
+ {
+ transform: `scale(0.5)`,
+ },
+ {
+ transform: `scale(1)`,
+ },
+ ],
+ {
+ extrapolateRight: 'clamp',
+ easing: Easing.circle,
+ },
+ ),
+ ).toEqual({transform: `scale(0.5669872981077807)`});
+});
+
test('Should not be able to interpolate transform with different structure', () => {
expect(() =>
interpolateStyles(