Add post video upload.
CI / test (pull_request) Successful in 6m24s

This commit is contained in:
2026-08-30 21:39:29 -07:00
parent 728ae68811
commit d7bfb93de1
4 changed files with 334 additions and 18 deletions
+18
View File
@@ -236,3 +236,21 @@ func assertPostEvent(t *testing.T, got, want events.PostEvent) {
t.Fatalf("event = %+v, want %+v", got, want)
}
}
func TestPostEventOmitsVideos(t *testing.T) {
t.Parallel()
srv, _ := newTestServer(t, Config{})
got := srv.postEvent(&store.Post{
ID: "root-1",
Title: "Clip",
Body: "Photo and video.",
Images: []store.PostImage{
{PublicURL: "https://cdn.example/a.jpg", Description: "Still", Kind: store.MediaKindImage},
{PublicURL: "https://cdn.example/a.mp4", Description: "Walkthrough", Kind: store.MediaKindVideo},
},
}, nil, nil)
if len(got.Images) != 1 || got.Images[0].URL != "https://cdn.example/a.jpg" {
t.Fatalf("event images = %+v", got.Images)
}
}