@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user