fix(server,web/m7-353): forward-fix CI — Mount call + AlbumRef test fixtures

This commit is contained in:
2026-05-04 17:31:27 -04:00
parent 4e3bd46d69
commit 93f54e00a4
7 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -443,7 +443,7 @@ func TestRoutesRegisteredInMount(t *testing.T) {
r := chi.NewRouter()
w := playevents.NewWriter(h.pool, slog.New(slog.NewTextHandler(io.Discard, nil)),
30*time.Minute, 0.5, 30000)
Mount(r, h.pool, h.logger, w, config.RecommendationConfig{RadioSize: 50, RadioSizeMax: 200, RecentlyPlayedHours: 1}, h.lidarrCfg, h.lidarrRequests, h.lidarrQuarantine, h.tracks, h.playlists, h.dataDir)
Mount(r, h.pool, h.logger, w, config.RecommendationConfig{RadioSize: 50, RadioSizeMax: 200, RecentlyPlayedHours: 1}, h.lidarrCfg, h.lidarrRequests, h.lidarrQuarantine, h.tracks, h.playlists, h.coverart, h.coverArtBackfillCap, h.dataDir)
paths := []string{
"/api/artists",
+1
View File
@@ -60,6 +60,7 @@ const album: AlbumRef = {
track_count: 5,
duration_sec: 2630,
cover_url: '/api/albums/xyz/cover',
cover_art_source: null,
};
afterEach(() => vi.clearAllMocks());
+2
View File
@@ -60,6 +60,7 @@ describe('album detail page', () => {
artist_id: 'md', artist_name: 'Miles Davis',
year: 1959, track_count: 2, duration_sec: 544 + 565,
cover_url: '/api/albums/xyz/cover',
cover_art_source: null,
tracks: [track('t1', 'So What', 1, 544), track('t2', 'Freddie Freeloader', 2, 565)]
};
(createAlbumQuery as ReturnType<typeof vi.fn>).mockReturnValue(mockQuery({ data: detail }));
@@ -87,6 +88,7 @@ describe('album detail page', () => {
artist_id: 'md', artist_name: 'Miles Davis',
track_count: 0, duration_sec: 0,
cover_url: '/api/albums/xyz/cover',
cover_art_source: null,
tracks: []
};
(createAlbumQuery as ReturnType<typeof vi.fn>).mockReturnValue(mockQuery({ data: detail }));
+2 -1
View File
@@ -43,7 +43,8 @@ function album(id: string, title: string, year?: number): AlbumRef {
sort_title: title,
artist_id: 'abc', artist_name: 'Alice',
year, track_count: 10, duration_sec: 2400,
cover_url: `/api/albums/${id}/cover`
cover_url: `/api/albums/${id}/cover`,
cover_art_source: null
};
}
+1 -1
View File
@@ -45,7 +45,7 @@ describe('liked library page', () => {
const ar: ArtistRef = { id: 'a1', name: 'X', sort_name: 'X', album_count: 1, cover_url: '' };
const al: AlbumRef = {
id: 'al1', title: 'Y', sort_title: 'Y', artist_id: 'a1', artist_name: 'X',
year: 2020, track_count: 1, duration_sec: 100, cover_url: '/x'
year: 2020, track_count: 1, duration_sec: 100, cover_url: '/x', cover_art_source: null
};
const tr: TrackRef = {
id: 't1', title: 'Z', album_id: 'al1', album_title: 'Y',
+1 -1
View File
@@ -45,7 +45,7 @@ function page<T>(items: T[], total: number, offset = 0, limit = 50): Page<T> {
const album: AlbumRef = {
id: 'al1', title: 'Kind of Blue', sort_title: 'Kind of Blue', artist_id: 'a1', artist_name: 'Miles Davis',
year: 1959, track_count: 5, duration_sec: 2630, cover_url: '/api/albums/al1/cover'
year: 1959, track_count: 5, duration_sec: 2630, cover_url: '/api/albums/al1/cover', cover_art_source: null
};
afterEach(() => {
+1 -1
View File
@@ -56,7 +56,7 @@ function emptyResp(): SearchResponse {
const artist: ArtistRef = { id: 'a1', name: 'Miles Davis', sort_name: 'Miles Davis', album_count: 12, cover_url: '' };
const album: AlbumRef = {
id: 'al1', title: 'Kind of Blue', sort_title: 'Kind of Blue', artist_id: 'a1', artist_name: 'Miles Davis',
year: 1959, track_count: 5, duration_sec: 2630, cover_url: '/api/albums/al1/cover'
year: 1959, track_count: 5, duration_sec: 2630, cover_url: '/api/albums/al1/cover', cover_art_source: null
};
const track: TrackRef = {
id: 't1', title: 'So What',