From 6ed9db4f0c9452baf4520e4810dc23af3f36e21c Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 28 Nov 2026 12:23:03 -0500 Subject: [PATCH] test(likes): seed the second copy at its own path (#8126) seedTrack derives the file path from the title, so two copies titled alike upserted into one row and the test compared a track with itself. Co-Authored-By: Claude Opus 5.5 --- internal/api/likes_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/api/likes_test.go b/internal/api/likes_test.go index 3597b5f4..81817b39 100644 --- a/internal/api/likes_test.go +++ b/internal/api/likes_test.go @@ -105,7 +105,9 @@ func TestLikeTrack_AnswersEveryCopyOfTheSong(t *testing.T) { album := seedAlbum(t, pool, artist.ID, "Harbour Street", 1969) best := seedAlbum(t, pool, artist.ID, "Best Of", 1975) first := seedTrack(t, pool, album.ID, artist.ID, "Something", 3, 183_000) - copied := seedTrack(t, pool, best.ID, artist.ID, "Something", 1, 183_000) + // seedTrack files each title at its own path, so the compilation copy + // gets a title of its own; song_id is what makes it the same song. + copied := seedTrack(t, pool, best.ID, artist.ID, "Something (Best Of)", 1, 183_000) if _, err := pool.Exec(context.Background(), "UPDATE tracks SET song_id = $1 WHERE id = $2", first.ID, copied.ID); err != nil { t.Fatal(err) }