Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: cover music track concept persistence (#4522)

[._.]/ Adam Eivyc49f378eb1cb
diff --git a/server/routes/tracks.test.js b/server/routes/tracks.test.js
index 96f353b313..a23ec8eda3 100644
--- a/server/routes/tracks.test.js
+++ b/server/routes/tracks.test.js
@@ -201,6 +201,13 @@ describe('tracks routes', () => {
expect(tracks.updateTrack).toHaveBeenCalledWith('track-1', { prompt: 'warm folk' });
});
+ it('PATCH /:id accepts a saved music-designer concept', async () => {
+ tracks.getTrack.mockResolvedValue({ id: 'track-1', title: 'Intro' });
+ const r = await request(app).patch('/api/tracks/track-1').send({ concept: 'A dusk-time pulse' });
+ expect(r.status).toBe(200);
+ expect(tracks.updateTrack).toHaveBeenCalledWith('track-1', { concept: 'A dusk-time pulse' });
+ });
+
it('DELETE /:id soft-deletes a track', async () => {
tracks.getTrack.mockResolvedValue({ id: 'track-1', title: 'Intro' });
const r = await request(app).delete('/api/tracks/track-1');
diff --git a/server/services/tracks/logic.test.js b/server/services/tracks/logic.test.js
index 79d44dfdd6..dfce5baba7 100644
--- a/server/services/tracks/logic.test.js
+++ b/server/services/tracks/logic.test.js
@@ -71,6 +71,13 @@ describe('tracks logic', () => {
expect(mergeTrackRecord(local, { ...local, title: 'New', updatedAt: '2099-01-01T00:00:00.000Z' }).remoteWins).toBe(true);
expect(mergeTrackRecord(local, { ...local, title: 'Old', updatedAt: '2000-01-01T00:00:00.000Z' }).remoteWins).toBe(false);
});
+
+ it('preserves a local concept when an older peer omits the additive field', () => {
+ const authored = buildTrackRecord({ title: 'Local', concept: 'A dusk-time pulse' }, { id: 'track-1', now: '2026-06-01T00:00:00.000Z' });
+ const remote = { ...authored, title: 'Remote', updatedAt: '2099-01-01T00:00:00.000Z' };
+ delete remote.concept;
+ expect(mergeTrackRecord(authored, remote).next.concept).toBe('A dusk-time pulse');
+ });
});
describe('render history', () => {