2026-10-07 19:40:26 +03:30
|
|
|
package api_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestCommunityEndpointPublic(t *testing.T) {
|
|
|
|
|
e := setup(t)
|
|
|
|
|
code, body := e.do(t, "GET", "/api/community", "", nil)
|
|
|
|
|
if code != http.StatusOK {
|
|
|
|
|
t.Fatalf("community: %d %v", code, body)
|
|
|
|
|
}
|
2026-10-10 16:42:35 +03:30
|
|
|
socials, ok := body["socials"].([]any)
|
2026-10-07 19:40:26 +03:30
|
|
|
if !ok {
|
2026-10-10 16:42:35 +03:30
|
|
|
t.Fatalf("missing socials: %v", body)
|
2026-10-07 19:40:26 +03:30
|
|
|
}
|
2026-10-10 16:42:35 +03:30
|
|
|
if socials == nil {
|
|
|
|
|
t.Fatal("socials must be a list")
|
2026-10-07 19:40:26 +03:30
|
|
|
}
|
2026-10-10 16:42:35 +03:30
|
|
|
if _, hasDonation := body["donation"]; hasDonation {
|
|
|
|
|
t.Fatal("donation must not be exposed")
|
2026-10-07 19:40:26 +03:30
|
|
|
}
|
|
|
|
|
// Telegram channel surface was removed from the product.
|
|
|
|
|
if _, hasChannel := body["channel"]; hasChannel {
|
|
|
|
|
t.Fatal("legacy channel field must not be exposed")
|
|
|
|
|
}
|
|
|
|
|
}
|