Add post video upload (#22)
CI / test (push) Successful in 6m28s

Questions and replies can attach one MP4 or WebM (25 MB) alongside up to four images. Videos are stored as-is and omitted from Discord embeds.

Reviewed-on: #22
Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #22.
This commit is contained in:
2026-08-31 06:28:53 +00:00
committed by codegirl007
parent 728ae68811
commit a6e414853d
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)
}
}