fix(server,web): update test fixtures for new New/Handler signatures

This commit is contained in:
2026-05-03 18:44:34 -04:00
parent ca82862346
commit f8684f0034
2 changed files with 11 additions and 9 deletions
+5 -3
View File
@@ -6,12 +6,14 @@ import (
"net/http/httptest"
"strings"
"testing"
"git.fabledsword.com/bvandeusen/minstrel/internal/config"
)
func TestHandler_ServesIndexAtRoot(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)
rec := httptest.NewRecorder()
Handler().ServeHTTP(rec, req)
Handler(config.BrandingConfig{}).ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want 200", rec.Code)
@@ -28,7 +30,7 @@ func TestHandler_ServesIndexAtRoot(t *testing.T) {
func TestHandler_UnknownPathFallsBackToIndex(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/artists/some-uuid", nil)
rec := httptest.NewRecorder()
Handler().ServeHTTP(rec, req)
Handler(config.BrandingConfig{}).ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want 200 (SPA fallback)", rec.Code)
@@ -41,7 +43,7 @@ func TestHandler_UnknownPathFallsBackToIndex(t *testing.T) {
func TestHandler_MissingAssetFallsBackToIndex(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/_app/immutable/chunks/does-not-exist.js", nil)
rec := httptest.NewRecorder()
Handler().ServeHTTP(rec, req)
Handler(config.BrandingConfig{}).ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d, want 200 (fallback to index.html)", rec.Code)