From e537662ee769d66d25c5d35a359d0873054c4e45 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Mon, 2 Nov 2026 22:22:18 +0100 Subject: [PATCH] test(cli): guard the v2 loader keeping render settings legacyProjectEditor (#1469) has its own tests; this one loads a v2 project through loadCliProject, so the export cannot drop the keys again behind a green helper test. --- src/cli/loadCliProject.test.ts | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/cli/loadCliProject.test.ts diff --git a/src/cli/loadCliProject.test.ts b/src/cli/loadCliProject.test.ts new file mode 100644 index 000000000..e4515d1a4 --- /dev/null +++ b/src/cli/loadCliProject.test.ts @@ -0,0 +1,55 @@ +import { describe, expect, it, vi } from "vitest"; +import { PROJECT_VERSION } from "@/components/video-editor/projectPersistence"; +import { getEditorSettings } from "@/lib/ai-edition/store/editorSettings"; +import { loadCliProject } from "./loadCliProject"; + +const loadProjectFileFromPath = vi.fn(); +vi.mock("@/native", () => ({ + nativeBridgeClient: { + project: { loadProjectFileFromPath: (p: string) => loadProjectFileFromPath(p) }, + }, +})); + +// `legacyProjectEditor` has its own tests in exportProject.test.ts; this one guards the loader +// actually using it, so a v2 export cannot drop the keys again behind a green helper test. +describe("loadCliProject", () => { + it("carries render settings the normalizer does not know into the exported document (#1467)", async () => { + loadProjectFileFromPath.mockResolvedValue({ + success: true, + project: { + version: PROJECT_VERSION, + media: { screenVideoPath: "/recordings/screen.mp4" }, + editor: { cursorModel3d: true, cursorClickSound: true, audioGainDb: -3 }, + }, + }); + vi.stubGlobal("window", { + electronAPI: { getCurrentRecordingSession: async () => ({ session: null }) }, + }); + // The probe's