mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 06:30:03 +00:00
fix: harden studio timeline editing and local renders (#463)
* fix: harden studio timeline editing and local renders * test: cover studio local render fallback * fix(studio): scale composition hover previews to stage size * test: normalize studio producer fallback paths * fix(studio): preserve move surface and retry render fallback
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveCompositionPreviewScale } from "./CompositionsTab";
|
||||
|
||||
describe("resolveCompositionPreviewScale", () => {
|
||||
it("scales a 16:9 stage to fit the composition card", () => {
|
||||
expect(
|
||||
resolveCompositionPreviewScale({
|
||||
cardWidth: 80,
|
||||
cardHeight: 45,
|
||||
stageWidth: 1920,
|
||||
stageHeight: 1080,
|
||||
}),
|
||||
).toBeCloseTo(80 / 1920);
|
||||
});
|
||||
|
||||
it("scales non-16:9 stages against their actual dimensions", () => {
|
||||
expect(
|
||||
resolveCompositionPreviewScale({
|
||||
cardWidth: 80,
|
||||
cardHeight: 45,
|
||||
stageWidth: 1280,
|
||||
stageHeight: 720,
|
||||
}),
|
||||
).toBeCloseTo(80 / 1280);
|
||||
});
|
||||
|
||||
it("falls back to the default stage when dimensions are invalid", () => {
|
||||
expect(
|
||||
resolveCompositionPreviewScale({
|
||||
cardWidth: 80,
|
||||
cardHeight: 45,
|
||||
stageWidth: 0,
|
||||
stageHeight: Number.NaN,
|
||||
}),
|
||||
).toBeCloseTo(80 / 1920);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user