mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 14:55:37 +00:00
add manager tests
This commit is contained in:
@@ -172,4 +172,34 @@ describe("local media path policy", () => {
|
||||
expect(result.path).toBe(projectPath);
|
||||
expect(result.project).toMatchObject({ videoPath });
|
||||
});
|
||||
|
||||
it("approves editor audioRegions audioPath entries when loading a project", async () => {
|
||||
const downloadsPath = path.join(tempRoot, "Downloads");
|
||||
const videoPath = path.join(tempPath, "recording.mp4");
|
||||
const audioPath = path.join(downloadsPath, "music.ogg");
|
||||
const projectPath = path.join(tempPath, "recording.recordly");
|
||||
await fs.mkdir(downloadsPath, { recursive: true });
|
||||
await fs.writeFile(videoPath, "test-video");
|
||||
await fs.writeFile(audioPath, "test-audio");
|
||||
await fs.writeFile(
|
||||
projectPath,
|
||||
JSON.stringify({
|
||||
version: 1,
|
||||
videoPath,
|
||||
editor: {
|
||||
audioRegions: [
|
||||
{ id: "a1", startMs: 0, endMs: 1000, audioPath, volume: 1 },
|
||||
],
|
||||
},
|
||||
}),
|
||||
"utf-8",
|
||||
);
|
||||
|
||||
const { loadProjectFromPath, resolveApprovedLocalMediaPath } = await import("./manager");
|
||||
const resolvedAudioPath = await fs.realpath(audioPath);
|
||||
|
||||
const result = await loadProjectFromPath(projectPath);
|
||||
expect(result.success).toBe(true);
|
||||
await expect(resolveApprovedLocalMediaPath(audioPath)).resolves.toBe(resolvedAudioPath);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ export function getBrowserMicSidecarFilters(profile?: string | null) {
|
||||
return BROWSER_MIC_SIDECAR_FILTERS;
|
||||
}
|
||||
|
||||
export const RECORDING_AUDIO_SIDECAR_DEBUG_ENV = "RECORDLY_KEEP_RECORDING_AUDIO_SIDECARS";
|
||||
export const RECORDING_AUDIO_SIDECAR_DEBUG_ENV = "RECORDLY_KEEP_RECORDING_AUDIO_SIDECARS"; // not used yet, because we need to have seperate audio files for system and mic for each recording
|
||||
|
||||
export function shouldKeepRecordingAudioSidecars(env: NodeJS.ProcessEnv = process.env) {
|
||||
const value = env[RECORDING_AUDIO_SIDECAR_DEBUG_ENV]?.trim().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user