release 0.3.12: bump federated service VERSION, installer image version and mcp package version
release gate / check (push) Failing after 5m50s
release / smoke (push) Successful in 10m43s
release / publish (push) Failing after 10m4s

This commit is contained in:
Andrew S Erwin
2026-11-30 12:30:33 -06:00
parent 886777d739
commit 50c89c1653
8 changed files with 56 additions and 11 deletions
+20 -2
View File
@@ -1,6 +1,7 @@
package http
import (
"context"
"fmt"
"io"
"net/http"
@@ -8,6 +9,8 @@ import (
"strings"
"sync"
"testing"
"gitea.federated.computer/Federated_Computer/superbrain/internal/db"
)
// fakeCarddav is a mutable CardDAV server for integration tests: a home at
@@ -214,8 +217,8 @@ func TestCardDavLifecycle(t *testing.T) {
// harness, so this asserts the rule is wired, not the failure itself).
func TestCardDavSuggestion(t *testing.T) {
t.Setenv("NEXTCLOUD_URL", "https://cloud.example")
srv := testServer(t)
c, _ := accountClient(t, srv.URL, "ksg@superbrain.test")
srv, d := testServerDB(t)
c, uid := accountClient(t, srv.URL, "ksg@superbrain.test")
sugg := c.request("GET", "/api/carddav/connections", nil, 200)["suggestions"].([]any)
if len(sugg) != 1 {
t.Fatalf("want one suggestion, got %v", sugg)
@@ -224,4 +227,19 @@ func TestCardDavSuggestion(t *testing.T) {
if m["kind"] != "nextcloud" || m["url"] != "https://cloud.example/remote.php/dav/addressbooks/users/" {
t.Fatalf("unexpected suggestion: %v", m)
}
// Once the Nextcloud contacts are connected (the unified Nextcloud connect
// creates a CardDAV row under this root), the suggestion is suppressed.
_, e := db.Insert(context.Background(), d, "CardDavConnection", map[string]any{
"id": "nc-carddav", "ownerId": uid, "name": "Nextcloud contacts",
"url": "https://cloud.example/remote.php/dav/addressbooks/users/erwin/",
"username": "erwin", "secret": "x",
})
if e != nil {
t.Fatal(e)
}
sugg = c.request("GET", "/api/carddav/connections", nil, 200)["suggestions"].([]any)
if len(sugg) != 0 {
t.Fatalf("suggestion not suppressed after Nextcloud connect: %v", sugg)
}
}