diff --git a/apps/desktop/src/lib/export.test.ts b/apps/desktop/src/lib/export.test.ts index 265e983d..6b451381 100644 --- a/apps/desktop/src/lib/export.test.ts +++ b/apps/desktop/src/lib/export.test.ts @@ -143,6 +143,33 @@ describe("export generation", () => { expect(parsed.headline).toBe(""); }); + it("generates chart summary JSON when export summary is absent", () => { + const songWithoutExportSummary: Partial = { ...mockSong }; + delete songWithoutExportSummary.exportSummary; + + const parsed = JSON.parse(generateChartSummaryJson(songWithoutExportSummary as RehearsalSong)); + + expect("exportSummary" in songWithoutExportSummary).toBe(false); + expect(parsed).toMatchObject({ + title: "Test", + headline: "", + sections: [ + { + label: "verse", + groove: "swing", + roles: [ + { + name: "Bass", + chord: "=Cmaj7", + cue: "1, 2, 3", + priority: "high" + } + ] + } + ] + }); + }); + it("generates a metadata-only local handoff without source paths or transcription data", () => { const sourceBootstrap: ProjectBootstrapSummary = { projectId: "project-1", @@ -202,7 +229,7 @@ describe("export generation", () => { }); }); - it("uses the song identity as the default handoff workspace identity", () => { + it("uses the song identity and an empty source asset list as the default handoff identity", () => { const json = generateMetadataHandoffJson(mockSong, { createdAt: "2026-06-15T08:30:00.000Z" }); @@ -213,6 +240,9 @@ describe("export generation", () => { title: "Test", workspaceVersion: 1 }); + expect(parsed).toHaveProperty("sourceAssets"); + expect(parsed.sourceAssets).toEqual([]); + expect(json).not.toContain("sourcePath"); }); it("creates a local re-analysis request from a received handoff and selected replacement asset", () => {