diff --git a/backend/internal/router/router_test.go b/backend/internal/router/router_test.go index 139b30a9..515d74ee 100644 --- a/backend/internal/router/router_test.go +++ b/backend/internal/router/router_test.go @@ -1081,6 +1081,10 @@ func TestDashboardIndexServesChatwootShell(t *testing.T) { if err := os.WriteFile(filepath.Join(dist, "assets", "app.js"), []byte(`document.documentElement.dataset.runtimeHost = window.__GOCHAT_CONFIG__?.hostURL || "missing";`), 0o644); err != nil { t.Fatal(err) } + favicon := []byte("gochat favicon") + if err := os.WriteFile(filepath.Join(dist, "favicon.ico"), favicon, 0o644); err != nil { + t.Fatal(err) + } t.Setenv("GOCHAT_FRONTEND_DIST", dist) t.Setenv("INSTALLATION_NAME", "GoChat Test") t.Setenv("FRONTEND_URL", "https://app.example.test/") @@ -1146,6 +1150,10 @@ func TestDashboardIndexServesChatwootShell(t *testing.T) { if asset.Code != http.StatusOK || asset.Body.String() != "body{}" { t.Fatalf("expected built asset, got %d %q", asset.Code, asset.Body.String()) } + faviconResponse := performGet(engine, "/favicon.ico") + if faviconResponse.Code != http.StatusOK || faviconResponse.Body.String() != string(favicon) { + t.Fatalf("expected built favicon, got %d %q", faviconResponse.Code, faviconResponse.Body.String()) + } } func TestDashboardIndexRejectsJSONLikeChatwoot(t *testing.T) {