fix(admin): add favicon and page-aware titles

This commit is contained in:
Jakub Zych
2026-10-07 10:39:22 +02:00
parent 9b3e630b6b
commit 5707f97089
8 changed files with 100 additions and 2 deletions

View File

@@ -165,7 +165,7 @@ func TestAPIPathsAreDelegated(t *testing.T) {
func TestMissingFileWithExtensionIs404(t *testing.T) {
h, _ := newTestHandler(t)
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/favicon.ico", testPrefix + "/golem/missing.css"} {
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/missing.ico", testPrefix + "/golem/missing.css"} {
rec := get(h, target)
if rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "summer-admin-base") {
t.Fatalf("%s status=%d body=%s", target, rec.Code, rec.Body.String())
@@ -276,6 +276,10 @@ func TestContentTypesAndCaching(t *testing.T) {
if got := ContentType("x.svg"); got != "image/svg+xml" {
t.Fatalf("svg type %q", got)
}
favicon := get(h, testPrefix+"/favicon.ico")
if favicon.Code != http.StatusOK || favicon.Header().Get("Content-Type") != "image/x-icon" || favicon.Header().Get("Cache-Control") != "no-cache" {
t.Fatalf("favicon headers = status %d, %v", favicon.Code, favicon.Header())
}
if got := ContentType("x.json"); got != "application/json" {
t.Fatalf("json type %q", got)
}