Skip to content

🎥 Make videos programmatically with React

condense test suite

JonnyBurgeraf3285d71d34
diff --git a/packages/web-renderer/src/test/scale.test.tsx b/packages/web-renderer/src/test/scale.test.tsx
index 47f08b1b8e..416175f65c 100644
--- a/packages/web-renderer/src/test/scale.test.tsx
+++ b/packages/web-renderer/src/test/scale.test.tsx
@@ -4,33 +4,16 @@ import '../symbol-dispose';
import {scaleFixture} from './fixtures/scale';
import {testImage} from './utils';
-test('scale=1 should render at original dimensions', async () => {
- const {blob} = await renderStillOnWeb({
- licenseKey: 'free-license',
- composition: scaleFixture,
- frame: 0,
- inputProps: {},
- imageFormat: 'png',
- scale: 1,
- });
-
- await testImage({blob, testId: 'scale-1x'});
-});
-
-test('scale=2 should render at 2x dimensions', async () => {
- const {blob} = await renderStillOnWeb({
+test('scale rendering behavior', async () => {
+ // Render once for each scale value
+ const {blob: blobDefault} = await renderStillOnWeb({
licenseKey: 'free-license',
composition: scaleFixture,
frame: 0,
inputProps: {},
imageFormat: 'png',
- scale: 2,
});
- await testImage({blob, testId: 'scale-2x'});
-});
-
-test('scale should increase output blob size', async () => {
const {blob: blob1x} = await renderStillOnWeb({
licenseKey: 'free-license',
composition: scaleFixture,
@@ -49,29 +32,14 @@ test('scale should increase output blob size', async () => {
scale: 2,
});
+ // Visual regression tests
+ await testImage({blob: blob1x, testId: 'scale-1x'});
+ await testImage({blob: blob2x, testId: 'scale-2x'});
+
+ // Scale should default to 1
+ expect(blobDefault.size).toBe(blob1x.size);
+
// scale=2 produces 4x pixels (2x width * 2x height)
// PNG compression varies but 2x blob should be noticeably larger
expect(blob2x.size).toBeGreaterThan(blob1x.size * 1.5);
});
-
-test('scale should default to 1 when not specified', async () => {
- const {blob: blobDefault} = await renderStillOnWeb({
- licenseKey: 'free-license',
- composition: scaleFixture,
- frame: 0,
- inputProps: {},
- imageFormat: 'png',
- });
-
- const {blob: blobExplicit} = await renderStillOnWeb({
- licenseKey: 'free-license',
- composition: scaleFixture,
- frame: 0,
- inputProps: {},
- imageFormat: 'png',
- scale: 1,
- });
-
- // Should produce same size when scale defaults to 1
- expect(blobDefault.size).toBe(blobExplicit.size);
-});