more test stuff
This commit is contained in:
parent
3e4584edde
commit
dfccf905bb
|
|
@ -119,3 +119,29 @@ export const v2ProjectEmptyScenes = {
|
|||
currentSceneId: "",
|
||||
scenes: [],
|
||||
};
|
||||
|
||||
export const v2ProjectSceneWithoutTracks = {
|
||||
id: "project-v2-no-tracks",
|
||||
version: 2,
|
||||
metadata: {
|
||||
id: "project-v2-no-tracks",
|
||||
name: "Scene Without Tracks",
|
||||
createdAt: "2024-04-01T00:00:00.000Z",
|
||||
updatedAt: "2024-04-01T00:00:00.000Z",
|
||||
},
|
||||
settings: {
|
||||
fps: 30,
|
||||
canvasSize: { width: 1920, height: 1080 },
|
||||
background: { type: "color", color: "#000000" },
|
||||
},
|
||||
currentSceneId: "scene-1",
|
||||
scenes: [
|
||||
{
|
||||
id: "scene-1",
|
||||
name: "Main Scene",
|
||||
isMain: true,
|
||||
createdAt: "2024-04-01T00:00:00.000Z",
|
||||
updatedAt: "2024-04-01T00:00:00.000Z",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
projectWithNoId,
|
||||
v2Project,
|
||||
v2ProjectEmptyScenes,
|
||||
v2ProjectSceneWithoutTracks,
|
||||
v2ProjectWithBlurBackground,
|
||||
v3Project,
|
||||
} from "./fixtures";
|
||||
|
|
@ -48,6 +49,16 @@ describe("V2 to V3 Migration", () => {
|
|||
expect(metadata.duration).toBe(0);
|
||||
});
|
||||
|
||||
test("handles scene without tracks property", () => {
|
||||
const result = transformProjectV2ToV3({
|
||||
project: v2ProjectSceneWithoutTracks,
|
||||
});
|
||||
|
||||
expect(result.skipped).toBe(false);
|
||||
const metadata = result.project.metadata as Record<string, unknown>;
|
||||
expect(metadata.duration).toBe(0);
|
||||
});
|
||||
|
||||
test("skips project that already has v3 structure", () => {
|
||||
const result = transformProjectV2ToV3({ project: v3Project });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue