Skip to content

🎥 Make videos programmatically with React

905 B
Raw Blame
import {test} from 'vitest';
import {page} from 'vitest/browser';
import {renderStillOnWeb} from '../render-still-on-web';
import '../symbol-dispose';
import {maskImage} from './fixtures/mask-image';
import {testImage} from './utils';

test('should render mask-image', async () => {
	await page.viewport(700, 300);
	const blob = await (
		await renderStillOnWeb({
			licenseKey: 'free-license',
			composition: maskImage,
			frame: 0,
			inputProps: {},
		})
	).blob({format: 'png'});

	await testImage({blob, testId: 'mask-image', threshold: 0.02});
});

test('should render mask-image (scaled)', async () => {
	await page.viewport(1400, 600);
	const blob = await (
		await renderStillOnWeb({
			licenseKey: 'free-license',
			composition: maskImage,
			frame: 0,
			inputProps: {},
			scale: 2,
		})
	).blob({format: 'png'});

	await testImage({blob, testId: 'mask-image-scaled', threshold: 0.02});
});