fix(server,web/m7-cover-sources): forward-fix CI round 2

Three issues from the previous push:

1. internal/api/admin_covers_test.go used t.Context() (Go 1.24+) but
   go.mod declares go 1.23.0. Replace with context.Background() in
   the testHandlersWithCovers helper; add "context" import.

2. internal/server/server_test.go's New() call missed the
   *coverart.SettingsService argument added in T11. The new param
   sits between the cover-art-backfill cap (int) and the *library.Scanner
   pointer in the function signature; the test was using 12 args
   instead of 13. Insert nil at the right position in all six call sites.

3. integrations.test.ts had 11 failing tests after T13 added the
   cover-art-providers section. Both panels render "Save changes",
   "Test connection", and "API key" controls, so the existing
   Lidarr tests' role/text queries matched multiple elements. Add
   helper functions (lidarrSection, coverProvidersSection,
   providerCard) and scope every relevant query with within() so
   each panel's tests interact only with their own controls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 13:55:35 -04:00
parent 5c386dc73e
commit 62222d8438
3 changed files with 45 additions and 27 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package api
import (
"context"
"encoding/json"
"log/slog"
"net/http"
@@ -46,7 +47,7 @@ func doAdminCoversReq(t *testing.T, h *handlers, method, path string, user dbq.U
func testHandlersWithCovers(t *testing.T) (*handlers, *coverart.Enricher) {
t.Helper()
h, pool := testHandlers(t)
settings, err := coverart.NewSettingsService(t.Context(), pool, slog.Default())
settings, err := coverart.NewSettingsService(context.Background(), pool, slog.Default())
if err != nil {
t.Fatalf("NewSettingsService: %v", err)
}