From d59b7fdc2a0ab840b3c906500c2dbd763d71e38b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 8 Oct 2026 22:17:17 -0400 Subject: [PATCH] fix(test): the mix-writer test reaches oneCopyPerSong through export_test; suspect fixtures carry the verdict (M498 #5439) Co-Authored-By: Claude Opus 5.5 --- internal/playlists/export_test.go | 10 ++++++++++ internal/playlists/song_copies_test.go | 7 ++++--- web/src/lib/api/admin.suspect-sources.test.ts | 4 +++- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 internal/playlists/export_test.go diff --git a/internal/playlists/export_test.go b/internal/playlists/export_test.go new file mode 100644 index 00000000..26920459 --- /dev/null +++ b/internal/playlists/export_test.go @@ -0,0 +1,10 @@ +package playlists + +// Bridges for the external playlists_test package, whose integration helpers +// (newPool, seedTrack) live there. + +// RankedCandidate is rankedCandidate, for tests. +type RankedCandidate = rankedCandidate + +// OneCopyPerSong is oneCopyPerSong, for tests. +var OneCopyPerSong = oneCopyPerSong diff --git a/internal/playlists/song_copies_test.go b/internal/playlists/song_copies_test.go index 68f52d4f..5488b1b2 100644 --- a/internal/playlists/song_copies_test.go +++ b/internal/playlists/song_copies_test.go @@ -1,4 +1,4 @@ -package playlists +package playlists_test import ( "context" @@ -7,6 +7,7 @@ import ( "github.com/jackc/pgx/v5/pgtype" "git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq" + "git.fabledsword.com/bvandeusen/minstrel/internal/playlists" ) // A mix holds a song once (M498 #5438) and never a held-back video rip @@ -30,10 +31,10 @@ func TestOneCopyPerSong_Integration(t *testing.T) { t.Fatal(err) } - in := []rankedCandidate{ + in := []playlists.RankedCandidate{ {TrackID: single.ID}, {TrackID: rip.ID}, {TrackID: albumCut.ID}, {TrackID: other.ID}, {TrackID: clean.ID}, } - out, err := oneCopyPerSong(ctx, q, in) + out, err := playlists.OneCopyPerSong(ctx, q, in) if err != nil { t.Fatal(err) } diff --git a/web/src/lib/api/admin.suspect-sources.test.ts b/web/src/lib/api/admin.suspect-sources.test.ts index 00caca9c..0d90aee9 100644 --- a/web/src/lib/api/admin.suspect-sources.test.ts +++ b/web/src/lib/api/admin.suspect-sources.test.ts @@ -14,7 +14,9 @@ function track(id: string): AdminSuspectTrack { duration_sec: 180, disc_number: null, track_number: null, - markers: [] + markers: [], + verdict: null, + verdict_at: null }; }